ruby-changes:69150
From: John <ko1@a...>
Date: Thu, 21 Oct 2021 08:21:01 +0900 (JST)
Subject: [ruby-changes:69150] 5506f2761f (master): Add test for setlocal
https://git.ruby-lang.org/ruby.git/commit/?id=5506f2761f From 5506f2761f6a65ab49f415b57120eb928154625e Mon Sep 17 00:00:00 2001 From: John Hawthorn <john@h...> Date: Fri, 17 Sep 2021 08:38:33 -0700 Subject: Add test for setlocal --- test/ruby/test_yjit.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index cd99924936..4672e83c9c 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -197,6 +197,20 @@ class TestYJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_yjit.rb#L197 RUBY end + def test_setlocal_with_level + assert_no_exits(<<~RUBY) + def sum(arr) + sum = 0 + arr.each do |x| + sum += x + end + sum + end + + sum([1,2,3]) + RUBY + end + def test_string_then_nil assert_compiles(<<~RUBY, insns: %i[opt_nil_p], result: true) def foo(val) -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/