summaryrefslogtreecommitdiff
path: root/test/ripper/test_lexer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ripper/test_lexer.rb')
-rw-r--r--test/ripper/test_lexer.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ripper/test_lexer.rb b/test/ripper/test_lexer.rb
index 72b7f1b5fd..30e5d78884 100644
--- a/test/ripper/test_lexer.rb
+++ b/test/ripper/test_lexer.rb
@@ -32,4 +32,23 @@ class TestRipper::Lexer < Test::Unit::TestCase
E
assert_equal(str, Ripper.tokenize(str).join(""), bug)
end
+
+ def test_embedded_expr_in_heredoc
+ src = <<~'E'
+ <<~B
+ #{1}
+ B
+ E
+ expect = %I[
+ on_heredoc_beg
+ on_nl
+ on_ignored_sp
+ on_embexpr_beg
+ on_int
+ on_embexpr_end
+ on_tstring_content
+ on_heredoc_end
+ ]
+ assert_equal expect, Ripper.lex(src).map {|e| e[1]}
+ end
end