diff options
author | Kazuki Tsujimoto <[email protected]> | 2021-08-19 17:03:17 +0900 |
---|---|---|
committer | Kazuki Tsujimoto <[email protected]> | 2021-08-19 17:07:58 +0900 |
commit | ecb6d6a4ef058b5598a7633c3921eeab08ce11c6 (patch) | |
tree | 0df5b09fae002fff45b63ccf6ca3afc07a9a9bae /test/ruby/test_pattern_matching.rb | |
parent | 00d66f7ec215406b5977fb490b06dae71a4fede6 (diff) |
Allow omission of parentheses in one line pattern matching [Feature #16182]
Diffstat (limited to 'test/ruby/test_pattern_matching.rb')
-rw-r--r-- | test/ruby/test_pattern_matching.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb index 42b6802fe6..277a0dcc51 100644 --- a/test/ruby/test_pattern_matching.rb +++ b/test/ruby/test_pattern_matching.rb @@ -1519,13 +1519,13 @@ END assert_raise(NoMatchingPatternError) do {a: 1} => {a: 0} end - assert_syntax_error("if {} => {a:}; end", /void value expression/) - assert_syntax_error(%q{ - 1 => a, b - }, /unexpected/, '[ruby-core:95098]') - assert_syntax_error(%q{ - 1 => a: - }, /unexpected/, '[ruby-core:95098]') + + [1, 2] => a, b + assert_equal 1, a + assert_equal 2, b + + {a: 1} => a: + assert_equal 1, a assert_equal true, (1 in 1) assert_equal false, (1 in 2) |