aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2019-11-10 22:34:49 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2019-11-10 22:34:49 +0900
commit6e70fa49b111e2a2839297b057a3df354cae265a (patch)
treef368c546779ee790addbb3036f3ff3ded240bf34 /test
parentef03d48cb20aa7739a4ac8eb4e109525a47fcc9f (diff)
downloadruby-6e70fa49b111e2a2839297b057a3df354cae265a.tar.gz
Disallow omission of parentheses/brackets in single line pattern matching [Feature #16182]
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_pattern_matching.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb
index 9af091a5e5..69524cb7a7 100644
--- a/test/ruby/test_pattern_matching.rb
+++ b/test/ruby/test_pattern_matching.rb
@@ -1261,7 +1261,13 @@ END
def test_modifier_in
assert_equal true, (1 in a)
assert_equal 1, a
- assert_valid_syntax "p(({} in a:), a:\n 1)"
+ assert_valid_syntax "p(({} in {a:}), a:\n 1)"
+ assert_syntax_error(%q{
+ 1 in a, b
+ }, /unexpected/, '[ruby-core:95098]')
+ assert_syntax_error(%q{
+ 1 in a:
+ }, /unexpected/, '[ruby-core:95098]')
end
end
END_of_GUARD