ruby-changes:55451
From: ktsj <ko1@a...>
Date: Sun, 21 Apr 2019 12:56:46 +0900 (JST)
Subject: [ruby-changes:55451] ktsj:r67672 (trunk): test/ruby/test_pattern_matching.rb: add missing tests for NODE_DASGN, NODE_LASGN
ktsj 2019-04-21 12:56:42 +0900 (Sun, 21 Apr 2019) New Revision: 67672 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67672 Log: test/ruby/test_pattern_matching.rb: add missing tests for NODE_DASGN, NODE_LASGN Modified files: trunk/test/ruby/test_pattern_matching.rb Index: test/ruby/test_pattern_matching.rb =================================================================== --- test/ruby/test_pattern_matching.rb (revision 67671) +++ test/ruby/test_pattern_matching.rb (revision 67672) @@ -193,6 +193,7 @@ class TestPatternMatching < Test::Unit:: https://github.com/ruby/ruby/blob/trunk/test/ruby/test_pattern_matching.rb#L193 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:: https://github.com/ruby/ruby/blob/trunk/test/ruby/test_pattern_matching.rb#L201 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/