diff options
author | ktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-21 03:56:42 +0000 |
---|---|---|
committer | ktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-21 03:56:42 +0000 |
commit | 710e763e72d925fc25cd5974158cc9e14016a81b (patch) | |
tree | be0b390b93437e12b44a66affacc62e9739aa70f /test | |
parent | 2dc51bf447dd837e9dc3189bbccaf23db0776816 (diff) | |
download | ruby-710e763e72d925fc25cd5974158cc9e14016a81b.tar.gz |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_pattern_matching.rb | 18 |
1 files changed, 18 insertions, 0 deletions
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 |