summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2022-09-09 14:00:27 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2022-09-09 14:00:27 +0900
commitdb0e0dad1171456253ebd899e7e878823923d3d8 (patch)
treeb508300c459b536d0bb8e92ca5c0a9e32710de3a /test
parent59eadf3d25b0f53e7570f98f1801737af642f328 (diff)
Fix unexpected "duplicated key name" error in paren-less one line pattern matching
[Bug #18990]
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_pattern_matching.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb
index 36731e14f9..fbb934dc84 100644
--- a/test/ruby/test_pattern_matching.rb
+++ b/test/ruby/test_pattern_matching.rb
@@ -1570,6 +1570,18 @@ END
assert_equal false, (1 in 2)
end
+ def test_bug18990
+ {a: 0} => a:
+ assert_equal 0, a
+ {a: 0} => a:
+ assert_equal 0, a
+
+ {a: 0} in a:
+ assert_equal 0, a
+ {a: 0} in a:
+ assert_equal 0, a
+ end
+
################################################################
def test_single_pattern_error_value_pattern