diff options
author | Kazuki Tsujimoto <[email protected]> | 2019-11-10 22:34:49 +0900 |
---|---|---|
committer | Kazuki Tsujimoto <[email protected]> | 2019-11-10 22:34:49 +0900 |
commit | 6e70fa49b111e2a2839297b057a3df354cae265a (patch) | |
tree | f368c546779ee790addbb3036f3ff3ded240bf34 /test/ruby/test_pattern_matching.rb | |
parent | ef03d48cb20aa7739a4ac8eb4e109525a47fcc9f (diff) |
Disallow omission of parentheses/brackets in single line pattern matching [Feature #16182]
Diffstat (limited to 'test/ruby/test_pattern_matching.rb')
-rw-r--r-- | test/ruby/test_pattern_matching.rb | 8 |
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 |