summaryrefslogtreecommitdiff
path: root/test/ripper
diff options
context:
space:
mode:
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_parser_events.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 86720b1446..2fca61e1d1 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -1017,6 +1017,10 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
tree = parse('%w[a]', :on_qwords_add) {thru_qwords_add = true}
assert_equal true, thru_qwords_add
assert_equal '[array([a])]', tree
+ thru_qwords_add = false
+ 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
@@ -1024,6 +1028,10 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
tree = parse('%i[a]', :on_qsymbols_add) {thru_qsymbols_add = true}
assert_equal true, thru_qsymbols_add
assert_equal '[array([:a])]', tree
+ thru_qsymbols_add = false
+ 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
@@ -1031,6 +1039,10 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
tree = parse('%I[a]', :on_symbols_add) {thru_symbols_add = true}
assert_equal true, thru_symbols_add
assert_equal '[array([:a])]', tree
+ thru_symbols_add = false
+ 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
@@ -1383,6 +1395,10 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
tree = parse('%W[a]', :on_words_add) {thru_words_add = true}
assert_equal true, thru_words_add
assert_equal '[array([a])]', tree
+ thru_words_add = false
+ 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