summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2024-09-02 02:56:18 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2024-09-02 02:56:18 -0700
commit6a4e79533b4454392f3afdfa0c4d35b763b68466 (patch)
tree23a27a800fbce80e01cba00f32da089f59fa3854 /test/ruby
parente0e23e7d5eb4da42c490b1d3408bd6e5047e8f83 (diff)
merge revision(s) 1870505f478cc75993b296b7144a45137ace6937: [Backport #20651]
Fix wrong unreachable chunk remove when jump destination label is unremovable
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 e8c6382300..dc9ef17ffe 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -780,6 +780,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:}