diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb index 175b308ce8..335a5193fa 100644 --- a/test/ruby/test_pattern_matching.rb +++ b/test/ruby/test_pattern_matching.rb @@ -193,6 +193,7 @@ class TestPatternMatching < Test::Unit::TestCase end def test_var_pattern + # NODE_DASGN_CURR assert_block do case [0, 1] in a, a @@ -200,6 +201,23 @@ class TestPatternMatching < Test::Unit::TestCase end end + # NODE_DASGN + b = 0 + assert_block do + case [0, 1] + in b, b + b == 1 + end + end + + # NODE_LASGN + case [0, 1] + in c, c + assert_equal(1, c) + else + flunk + end + assert_syntax_error(%q{ case 0 in ^a