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.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ripper/test_lexer.rb b/test/ripper/test_lexer.rb
index 9762478c62..79cb194e5b 100644
--- a/test/ripper/test_lexer.rb
+++ b/test/ripper/test_lexer.rb
@@ -90,6 +90,16 @@ class TestRipper::Lexer < Test::Unit::TestCase
assert_equal expect, Ripper.lex(src).map {|e| e[1]}
end
+ def test_stack_at_on_heredoc_beg
+ src = "a <<b"
+ expect = %I[
+ on_ident
+ on_sp
+ on_heredoc_beg
+ ]
+ assert_equal expect, Ripper.lex(src).map {|e| e[1]}
+ end
+
def test_slice
assert_equal "string\#{nil}\n",
Ripper.slice(%(<<HERE\nstring\#{nil}\nHERE), "heredoc_beg .*? nl $(.*?) heredoc_end", 1)