summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-24 00:55:36 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-24 00:55:36 +0000
commita5314e45d027dd81cd9eb4945ed669367d3ffa83 (patch)
tree431ab75d486e9ce96ac255c7195efa90d6f03897 /test
parent75a105756e7c2d7f37aa31f6476414db7265d643 (diff)
downloadruby-a5314e45d027dd81cd9eb4945ed669367d3ffa83.tar.gz
ruby-a5314e45d027dd81cd9eb4945ed669367d3ffa83.tar.xz
ruby-a5314e45d027dd81cd9eb4945ed669367d3ffa83.zip
add a test for String#hash.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_m17n.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 002681633..a6a85628c 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1831,6 +1831,14 @@ class TestM17N < Test::Unit::TestCase
}
end
+ def test_str_hash
+ combination(STRINGS, STRINGS) {|s1, s2|
+ if s1.eql?(s2)
+ assert_equal(s1.hash, s2.hash, "#{encdump s1}.hash == #{encdump s2}.dump")
+ end
+ }
+ end
+
def test_sub
s = "abc".sub(/b/, "\xa1\xa1".force_encoding("euc-jp"))
assert_encoding("EUC-JP", s.encoding)