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:
parent
2b9448fd77
commit
87b03e8c3c
4 changed files with 53 additions and 53 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue