summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2025-03-10 14:52:06 -0400
committerTakashi Kokubun <takashikkbn@gmail.com>2025-04-18 21:52:59 +0900
commit113080936355d2e43dbbb0bcd0b09bf93966f2f6 (patch)
tree9c934321050afec65b55a473ba9d6219c46346da /test/ruby
parent5fa12b36c2e4d6a5cf2247e6b06d2e2661ae34b1 (diff)
Add small test for setlocal
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13131
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_zjit.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 3495c1254a..5265aac246 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -30,6 +30,16 @@ class TestZJIT < Test::Unit::TestCase
}
end
+ def test_setlocal
+ assert_compiles '3', %q{
+ def test(n)
+ m = n
+ m
+ end
+ test(3)
+ }
+ end
+
def test_opt_plus_const
assert_compiles '3', %q{
def test = 1 + 2