From ecb6d6a4ef058b5598a7633c3921eeab08ce11c6 Mon Sep 17 00:00:00 2001 From: Kazuki Tsujimoto Date: Thu, 19 Aug 2021 17:03:17 +0900 Subject: Allow omission of parentheses in one line pattern matching [Feature #16182] --- test/ruby/test_pattern_matching.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/ruby/test_pattern_matching.rb') 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) -- cgit v1.2.3