aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-26 00:33:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-26 00:33:06 +0000
commit96c01b455248598f981d78f7784b5b19e905dc54 (patch)
tree3929d0e2ad3c603ae44b673a8a57b6d66d909617 /test/ruby/test_syntax.rb
parent0ee5415d554ccd480fb5be910b0ff4885be7a35a (diff)
downloadruby-96c01b455248598f981d78f7784b5b19e905dc54.tar.gz
parse.y: indent at invalid identifier
* parse.y (parser_heredoc_identifier): set indent only when valid identifier, not to dedent non-existent contents later. [ruby-core:79772] [Bug #13253] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index f4358d44a1..5cfc13ec89 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -656,6 +656,10 @@ eom
assert_equal(expected, actual, bug7559)
end
+ def test_dedented_heredoc_invalid_identifer
+ assert_syntax_error('<<~ "#{}"', /unexpected <</)
+ end
+
def test_lineno_operation_brace_block
expected = __LINE__ + 1
actual = caller_lineno\