diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 00:55:36 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 00:55:36 +0000 |
commit | c806d3f53f65b9dc43bfc4636f047b7a86757246 (patch) | |
tree | 431ab75d486e9ce96ac255c7195efa90d6f03897 /test/ruby/test_m17n.rb | |
parent | 9c7718ac6b7b91d2613a02b8630b2916abf67f2f (diff) |
add a test for String#hash.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r-- | test/ruby/test_m17n.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 0026816335..a6a85628cd 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) |