From c7bacf84f04201787d26e4a4be8aca61ff1e454b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 24 Apr 2023 22:21:57 +0900 Subject: [Bug #19611] Remove never-reachable branch in logical expression --- test/ruby/test_iseq.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') 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 -- cgit v1.2.1