summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authortomoya ishida <tomoyapenguin@gmail.com>2024-07-30 15:31:58 +0900
committerGitHub <noreply@github.com>2024-07-30 15:31:58 +0900
commit1870505f478cc75993b296b7144a45137ace6937 (patch)
tree70b82c15af740c8ca49adb22be47d3f9c03c5cea /test/ruby
parent77f8107efaccbc8a5472ea3578c27c912045d7b1 (diff)
Fix wrong unreachable chunk remove when jump destination label is unremovable
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11267 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_iseq.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index c946d588c1..9429d8bc21 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -813,6 +813,11 @@ class TestISeq < Test::Unit::TestCase
end
def test_unreachable_pattern_matching
+ assert_in_out_err([], "true or 1 in 1")
+ assert_in_out_err([], "true or (case 1; in 1; 1; in 2; 2; end)")
+ end
+
+ def test_unreachable_pattern_matching_in_if_condition
assert_in_out_err([], "#{<<~"begin;"}\n#{<<~'end;'}", %w[1])
begin;
if true or {a: 0} in {a:}