summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLi Yazhou <[email protected]>2014-02-14 13:26:19 +0800
committerLi Yazhou <[email protected]>2014-02-14 13:26:19 +0800
commit7ab0506795ca8a758043115f88cd8288389835c4 (patch)
tree73e27d754b86f4cf74d71ea782dc8fbf7a0dc974
parentadbf1eba99b99ddb18c3493c5294c0cc83f78f78 (diff)
downloadmruby-7ab0506795ca8a758043115f88cd8288389835c4.tar.gz
mruby-7ab0506795ca8a758043115f88cd8288389835c4.zip
add test for Hash#dup
-rw-r--r--test/t/hash.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/t/hash.rb b/test/t/hash.rb
index 39f9ae9d8..837fe0216 100644
--- a/test/t/hash.rb
+++ b/test/t/hash.rb
@@ -34,6 +34,13 @@ assert('Hash#clear', '15.2.13.4.4') do
assert_equal({ }, a)
end
+assert('Hash#dup') do
+ a = { 'a' => 1 }
+ b = a.dup
+ a['a'] = 2
+ assert_equal(b, {'a' => 1})
+end
+
assert('Hash#default', '15.2.13.4.5') do
a = Hash.new
b = Hash.new('abc')