ruby-changes:3070
From: ko1@a...
Date: 24 Dec 2007 09:55:43 +0900
Subject: [ruby-changes:3070] akr - Ruby:r14562 (trunk): add a test for String#hash.
akr 2007-12-24 09:55:36 +0900 (Mon, 24 Dec 2007)
New Revision: 14562
Modified files:
trunk/test/ruby/test_m17n.rb
Log:
add a test for String#hash.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_m17n.rb?r1=14562&r2=14561
Index: test/ruby/test_m17n.rb
===================================================================
--- test/ruby/test_m17n.rb (revision 14561)
+++ test/ruby/test_m17n.rb (revision 14562)
@@ -1831,6 +1831,14 @@
}
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)
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml