summaryrefslogtreecommitdiff
path: root/test/ruby/test_pattern_matching.rb
diff options
context:
space:
mode:
authorKazuki Tsujimoto <[email protected]>2021-08-19 17:03:17 +0900
committerKazuki Tsujimoto <[email protected]>2021-08-19 17:07:58 +0900
commitecb6d6a4ef058b5598a7633c3921eeab08ce11c6 (patch)
tree0df5b09fae002fff45b63ccf6ca3afc07a9a9bae /test/ruby/test_pattern_matching.rb
parent00d66f7ec215406b5977fb490b06dae71a4fede6 (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.rb14
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)