aboutsummaryrefslogtreecommitdiffstats
path: root/test/ripper/test_parser_events.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ripper/test_parser_events.rb')
-rw-r--r--test/ripper/test_parser_events.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 55485b68d0..540d36e4d9 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -431,6 +431,19 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_equal("heredoc1\nheredoc2\n", heredoc, bug1921)
end
+ def test_heredoc_dedent
+ thru_heredoc_dedent = false
+ str = width = nil
+ tree = parse("<""<~EOS\n heredoc\nEOS\n", :on_heredoc_dedent) {|e, s, w|
+ thru_heredoc_dedent = true
+ str = s
+ width = w
+ }
+ assert_equal true, thru_heredoc_dedent
+ assert_match(/string_content\(\), heredoc\n/, tree)
+ assert_equal(1, width)
+ end
+
def test_massign
thru_massign = false
parse("a, b = 1, 2", :on_massign) {thru_massign = true}