mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix unreachable warning line number
* parse.y (block_append_gen): fix unreachable warning line number. should warn at the code, not jump. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
be2dc4434a
commit
7af3e9f08b
3 changed files with 13 additions and 1 deletions
|
@ -96,6 +96,13 @@ class TestSyntax < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_warn_unreachable
|
||||
assert_warn("test:3: warning: statement not reached\n") do
|
||||
code = "loop do\n" "break\n" "foo\n" "end"
|
||||
assert_valid_syntax(code, "test") {$VERBOSE = true}
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def make_tmpsrc(f, src)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue