From c806d3f53f65b9dc43bfc4636f047b7a86757246 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 24 Dec 2007 00:55:36 +0000 Subject: [PATCH] add a test for String#hash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_m17n.rb | 8 ++++++++ 1 file changed, 8 insertions(+) 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)