From 710e763e72d925fc25cd5974158cc9e14016a81b Mon Sep 17 00:00:00 2001 From: ktsj Date: Sun, 21 Apr 2019 03:56:42 +0000 Subject: test/ruby/test_pattern_matching.rb: add missing tests for NODE_DASGN, NODE_LASGN git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_pattern_matching.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (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 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 -- cgit v1.2.3