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

parser: improve error messages

[Fix GH-2011]

From: Akim Demaille <akim.demaille@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-11-25 08:31:40 +00:00
parent 2b9448fd77
commit 87b03e8c3c
4 changed files with 53 additions and 53 deletions

View file

@ -155,7 +155,7 @@ class TestAst < Test::Unit::TestCase
end
def test_parse_raises_syntax_error
assert_raise_with_message(SyntaxError, /keyword_end/) do
assert_raise_with_message(SyntaxError, /\bend\b/) do
RubyVM::AbstractSyntaxTree.parse("end")
end
end
@ -164,7 +164,7 @@ class TestAst < Test::Unit::TestCase
Tempfile.create(%w"test_ast .rb") do |f|
f.puts "end"
f.close
assert_raise_with_message(SyntaxError, /keyword_end/) do
assert_raise_with_message(SyntaxError, /\bend\b/) do
RubyVM::AbstractSyntaxTree.parse_file(f.path)
end
end