diff options
| author | Shugo Maeda <[email protected]> | 2016-12-07 22:39:20 +0900 |
|---|---|---|
| committer | Shugo Maeda <[email protected]> | 2016-12-07 22:39:20 +0900 |
| commit | 338e0ff52d645556e644ac08b3efc6ea31868c59 (patch) | |
| tree | 83c10ee51f45db611b150475d2371542e7bfdf6b /test | |
| parent | 2b0dd1f48194e59ff839ec97d0fde7df76f325ea (diff) | |
| download | mruby-338e0ff52d645556e644ac08b3efc6ea31868c59.tar.gz mruby-338e0ff52d645556e644ac08b3efc6ea31868c59.zip | |
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 |
