diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-03-23 12:34:32 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-03-23 12:34:32 +0900 |
| commit | 817b884343cc349d3c32da7f1c65cb4867963bde (patch) | |
| tree | 49ffcd28618ed32c94c393dfa9367daae02a6249 /mrbgems/mruby-hash-ext | |
| parent | daf83946bbf2834da8393cd50af2bc7bcee3289f (diff) | |
| download | mruby-817b884343cc349d3c32da7f1c65cb4867963bde.tar.gz mruby-817b884343cc349d3c32da7f1c65cb4867963bde.zip | |
add #dig tests
Diffstat (limited to 'mrbgems/mruby-hash-ext')
| -rw-r--r-- | mrbgems/mruby-hash-ext/test/hash.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mrbgems/mruby-hash-ext/test/hash.rb b/mrbgems/mruby-hash-ext/test/hash.rb index 8b6b2e5b9..b43541b7f 100644 --- a/mrbgems/mruby-hash-ext/test/hash.rb +++ b/mrbgems/mruby-hash-ext/test/hash.rb @@ -236,3 +236,9 @@ assert('Hash#>') do assert_false(h2 > h1) assert_false(h2 > h2) end + +assert("Hash#dig") do + h = {a:{b:{c:1}}} + assert_equal(1, h.dig(:a, :b, :c)) + assert_nil(h.dig(:d)) +end |
