summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorksss <[email protected]>2014-03-07 11:08:24 +0900
committerksss <[email protected]>2014-03-07 11:08:24 +0900
commitcab1f734ef9a9eb6b31d792bfc818e5cb4f3b300 (patch)
tree07b9e610a9b0665ee2e7fc6deae6ddbe2f5c2e75 /test
parente40428af7b02870663a6c052496c176c22c5e875 (diff)
downloadmruby-cab1f734ef9a9eb6b31d792bfc818e5cb4f3b300.tar.gz
mruby-cab1f734ef9a9eb6b31d792bfc818e5cb4f3b300.zip
Fix behavior Hash#eql?
Diffstat (limited to 'test')
-rw-r--r--test/t/hash.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/t/hash.rb b/test/t/hash.rb
index 837fe0216..92bc223b6 100644
--- a/test/t/hash.rb
+++ b/test/t/hash.rb
@@ -269,6 +269,14 @@ end
# Not ISO specified
+assert('Hash#eql?') do
+ a = { 'a' => 1, 'b' => 2, 'c' => 3 }
+ b = { 'a' => 1, 'b' => 2, 'c' => 3 }
+ c = { 'a' => 1.0, 'b' => 2, 'c' => 3 }
+ assert_true(a.eql?(b))
+ assert_false(a.eql?(c))
+end
+
assert('Hash#reject') do
h = {:one => 1, :two => 2, :three => 3, :four => 4}
ret = h.reject do |k,v|