summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-24 22:21:57 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-27 14:52:22 +0900
commitc7bacf84f04201787d26e4a4be8aca61ff1e454b (patch)
treebf4b32fe97805125228deec22daf63ba12a5c2be /test
parentb0cb54a378f2c588a050dafe6db69cb4cdd2637e (diff)
downloadruby-c7bacf84f04201787d26e4a4be8aca61ff1e454b.tar.gz
[Bug #19611] Remove never-reachable branch in logical expression
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_iseq.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index 3692a697d6..682fa52570 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -759,4 +759,14 @@ class TestISeq < Test::Unit::TestCase
assert_equal :new, r.take
RUBY
end
+
+ def test_ever_condition_loop
+ assert_ruby_status([], "BEGIN {exit}; while true && true; end")
+ end
+
+ def test_unreachable_syntax_error
+ mesg = /Invalid break/
+ assert_syntax_error("false and break", mesg)
+ assert_syntax_error("if false and break; end", mesg)
+ end
end