From 6e70fa49b111e2a2839297b057a3df354cae265a Mon Sep 17 00:00:00 2001 From: Kazuki Tsujimoto Date: Sun, 10 Nov 2019 22:34:49 +0900 Subject: Disallow omission of parentheses/brackets in single line pattern matching [Feature #16182] --- test/ruby/test_pattern_matching.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') 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 -- cgit v1.2.3