summaryrefslogtreecommitdiff
path: root/test/ripper
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-19 05:10:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-19 05:10:38 +0000
commit8b501f6d7fa6aa85912dc36abccdac8915fe3b22 (patch)
treef8e6165495c7761c9795c4a8e8cdb758564ff603 /test/ripper
parent0e7936f89647a8ba2cd664dfde47e6a2e2c94e69 (diff)
parse.y: indent at '#'
* parse.y (parser_here_document): update indent at '#', which is not a space. [ruby-core:83368] [Bug #14032] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_lexer.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ripper/test_lexer.rb b/test/ripper/test_lexer.rb
index f900ee935d..2a1c7881e4 100644
--- a/test/ripper/test_lexer.rb
+++ b/test/ripper/test_lexer.rb
@@ -70,4 +70,24 @@ class TestRipper::Lexer < Test::Unit::TestCase
]
assert_equal expect, Ripper.lex(src).map {|e| e[1]}
end
+
+ def test_expr_at_beginning_in_heredoc
+ src = <<~'E'
+ <<~B
+ a
+ #{1}
+ B
+ E
+ expect = %I[
+ on_heredoc_beg
+ on_nl
+ on_tstring_content
+ 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