mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test for String#hash.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9c7718ac6b
commit
c806d3f53f
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue