summaryrefslogtreecommitdiff
path: root/test/ripper/test_parser_events.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-24 04:26:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-24 04:26:23 +0000
commit9c86c513f0912af07c9addb57026bab385abea35 (patch)
tree7a7527778f1f368d21e4ab89168d00df0056885c /test/ripper/test_parser_events.rb
parent4046ca57967b016fd82f3f065aae3732c15c301e (diff)
downloadruby-9c86c513f0912af07c9addb57026bab385abea35.tar.gz
test_parser_events.rb: results of list literals
* test/ripper/test_parser_events.rb (test_qwords_add), (test_qsymbols_add, test_symbols_add, test_words_add): more assertions for results of list literals. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper/test_parser_events.rb')
-rw-r--r--test/ripper/test_parser_events.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index cf118a49c2..86720b1446 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -1014,20 +1014,23 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
def test_qwords_add
thru_qwords_add = false
- parse('%w[a]', :on_qwords_add) {thru_qwords_add = true}
+ tree = parse('%w[a]', :on_qwords_add) {thru_qwords_add = true}
assert_equal true, thru_qwords_add
+ assert_equal '[array([a])]', tree
end
def test_qsymbols_add
thru_qsymbols_add = false
- parse('%i[a]', :on_qsymbols_add) {thru_qsymbols_add = true}
+ tree = parse('%i[a]', :on_qsymbols_add) {thru_qsymbols_add = true}
assert_equal true, thru_qsymbols_add
+ assert_equal '[array([:a])]', tree
end
def test_symbols_add
thru_symbols_add = false
- parse('%I[a]', :on_symbols_add) {thru_symbols_add = true}
+ tree = parse('%I[a]', :on_symbols_add) {thru_symbols_add = true}
assert_equal true, thru_symbols_add
+ assert_equal '[array([:a])]', tree
end
def test_qwords_new
@@ -1377,8 +1380,9 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
def test_words_add
thru_words_add = false
- parse('%W[a]', :on_words_add) {thru_words_add = true}
+ tree = parse('%W[a]', :on_words_add) {thru_words_add = true}
assert_equal true, thru_words_add
+ assert_equal '[array([a])]', tree
end
def test_words_new