aboutsummaryrefslogtreecommitdiffstats
path: root/test/ripper/test_parser_events.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-01 01:29:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-01 01:29:22 +0000
commit046f8469f322756c4fb7676e551ed7d62e4d629f (patch)
treebb90b71ec58be98adf8c7acec847033a0a8cdc6b /test/ripper/test_parser_events.rb
parent24171da2226cf82bdd46b691d56ccffafb6b30b4 (diff)
downloadruby-046f8469f322756c4fb7676e551ed7d62e4d629f.tar.gz
test_parser_events.rb: simplify
* test/ripper/dummyparser.rb (DummyParser): simplified mlhs node representation. * test/ripper/test_parser_events.rb (test_mlhs_add_star): simplified assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper/test_parser_events.rb')
-rw-r--r--test/ripper/test_parser_events.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 7eac20a3ec..94c55aa15e 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -470,23 +470,23 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
thru_mlhs_add_star = false
tree = parse("a, *b = 1, 2", :on_mlhs_add_star) {thru_mlhs_add_star = true}
assert_equal true, thru_mlhs_add_star
- assert_match(/mlhs_add_star\(mlhs_add\(mlhs_new\(\),a\),b\)/, tree)
+ assert_include(tree, "massign([a,*b]")
thru_mlhs_add_star = false
tree = parse("a, *b, c = 1, 2", :on_mlhs_add_star) {thru_mlhs_add_star = true}
assert_equal true, thru_mlhs_add_star
- assert_match(/mlhs_add\(mlhs_add_star\(mlhs_add\(mlhs_new\(\),a\),b\),mlhs_add\(mlhs_new\(\),c\)\)/, tree, bug2232)
+ assert_include(tree, "massign([a,*b,[c]]", bug2232)
thru_mlhs_add_star = false
tree = parse("a, *, c = 1, 2", :on_mlhs_add_star) {thru_mlhs_add_star = true}
assert_equal true, thru_mlhs_add_star
- assert_match(/mlhs_add\(mlhs_add_star\(mlhs_add\(mlhs_new\(\),a\)\),mlhs_add\(mlhs_new\(\),c\)\)/, tree, bug4364)
+ assert_include(tree, "massign([a,*,[c]]", bug4364)
thru_mlhs_add_star = false
tree = parse("*b, c = 1, 2", :on_mlhs_add_star) {thru_mlhs_add_star = true}
assert_equal true, thru_mlhs_add_star
- assert_match(/mlhs_add\(mlhs_add_star\(mlhs_new\(\),b\),mlhs_add\(mlhs_new\(\),c\)\)/, tree, bug4364)
+ assert_include(tree, "massign([*b,[c]]", bug4364)
thru_mlhs_add_star = false
tree = parse("*, c = 1, 2", :on_mlhs_add_star) {thru_mlhs_add_star = true}
assert_equal true, thru_mlhs_add_star
- assert_match(/mlhs_add\(mlhs_add_star\(mlhs_new\(\)\),mlhs_add\(mlhs_new\(\),c\)\)/, tree, bug4364)
+ assert_include(tree, "massign([*,[c]],", bug4364)
end
def test_mlhs_new