mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Adds mixed hash value and value omission tests
Introduces specification tests for mixed values and value omissions for Hashes and keyword arguments, such as `{ a:, b:, c: 3 }`.
This commit is contained in:
parent
2982464a8e
commit
4676921730
Notes:
git
2021-09-13 13:55:41 +09:00
2 changed files with 2 additions and 0 deletions
|
@ -4357,6 +4357,7 @@ class TestKeywordArgumentsSymProcRefinements < Test::Unit::TestCase
|
|||
x = 1
|
||||
y = 2
|
||||
assert_equal({x: 1, y: 2}, f.call(x:, y:))
|
||||
assert_equal({x: 1, y: 2, z: 3}, f.call(x:, y:, z: 3))
|
||||
assert_equal({one: 1, two: 2}, f.call(one:, two:))
|
||||
end
|
||||
|
||||
|
|
|
@ -510,6 +510,7 @@ class TestRubyLiteral < Test::Unit::TestCase
|
|||
x = 1
|
||||
y = 2
|
||||
assert_equal({x: 1, y: 2}, {x:, y:})
|
||||
assert_equal({x: 1, y: 2, z: 3}, {x:, y:, z: 3})
|
||||
assert_equal({one: 1, two: 2}, {one:, two:})
|
||||
assert_syntax_error('{"#{x}":}', /'\}'/)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue