summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-16 08:42:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-16 08:42:16 +0000
commit7af3e9f08b6f277b7f96d7ed2a0115d1452d98cc (patch)
treea4048a41beb89a2cff7a7889f689e04ad2dcb5e4 /test
parentbe2dc4434a3f854d32b24fe08fbbc28116df7a7f (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 8be81dcb4d..51a0f355f8 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -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)