diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-12-08 01:04:25 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-12-08 01:04:25 +0900 |
| commit | 5930a6ebc7a5ebf0c9b2dfe1d250935e6ddaeceb (patch) | |
| tree | 06afd263df20ba8f955be181308433791b58379f /test | |
| parent | edf26d4043dc55202a0a71252b43956c71f99ab7 (diff) | |
| parent | 338e0ff52d645556e644ac08b3efc6ea31868c59 (diff) | |
| download | mruby-5930a6ebc7a5ebf0c9b2dfe1d250935e6ddaeceb.tar.gz mruby-5930a6ebc7a5ebf0c9b2dfe1d250935e6ddaeceb.zip | |
Merge pull request #3328 from shugo/hash-dup-default_proc
Copy default_proc by Hash#dup.
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/hash.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/t/hash.rb b/test/t/hash.rb index b455812cf..f076db8e5 100644 --- a/test/t/hash.rb +++ b/test/t/hash.rb @@ -44,6 +44,10 @@ assert('Hash#dup') do b = a.dup a['a'] = 2 assert_equal({'a' => 1}, b) + + c = Hash.new { |h, k| h[k] = k.upcase } + d = c.dup + assert_equal("FOO", d["foo"]) end assert('Hash#default', '15.2.13.4.5') do |
