summaryrefslogtreecommitdiff
path: root/test/ruby/test_literal.rb
diff options
context:
space:
mode:
authorBrandon Weaver <keystonelemur@gmail.com>2021-09-12 20:34:28 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-09-13 13:54:03 +0900
commit4676921730bd257c234396fd9134ae9876043756 (patch)
treee6e2174ddeebb81cca2b49065b54eb5fb8a8b2a4 /test/ruby/test_literal.rb
parent2982464a8e3f07e769d8d6eb0fd70b01c168a962 (diff)
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 }`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4829
Diffstat (limited to 'test/ruby/test_literal.rb')
-rw-r--r--test/ruby/test_literal.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb
index c8a65c923a..ccfe1b1919 100644
--- a/test/ruby/test_literal.rb
+++ b/test/ruby/test_literal.rb
@@ -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