1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Test for unterminated here-docs

This commit is contained in:
Nobuyoshi Nakada 2019-06-27 15:13:45 +09:00
parent c86a9e6592
commit 2a56702eee
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -485,6 +485,12 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_equal(1, width)
end
def test_unterminated_heredoc
assert_match("can't find string \"a\" anywhere before EOF", compile_error("<<a"))
assert_match("can't find string \"a\" anywhere before EOF", compile_error('<<"a"'))
assert_match("can't find string \"a\" anywhere before EOF", compile_error("<<'a'"))
end
def test_massign
thru_massign = false
parse("a, b = 1, 2", :on_massign) {thru_massign = true}