summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
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)