summaryrefslogtreecommitdiff
path: root/test/ruby/test_zjit.rb
diff options
context:
space:
mode:
authorStan Lo <stan.lo@shopify.com>2025-08-11 23:07:26 +0100
committerGitHub <noreply@github.com>2025-08-11 15:07:26 -0700
commite29d33345402f554220c35617e897e6d52bbecff (patch)
tree6a7d6a0bc29e89dc7035e72ef5a9b77f8b2d3c74 /test/ruby/test_zjit.rb
parent4f34eddbd3c701bdc1ccc93a192a127e0c33202c (diff)
ZJIT: Implement `concatstrings` insn (#14154)
Co-authored-by: Alexander Momchilov <alexander.momchilov@shopify.com>
Diffstat (limited to 'test/ruby/test_zjit.rb')
-rw-r--r--test/ruby/test_zjit.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index bf43fd1324..4dc0919b6b 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -1506,6 +1506,22 @@ class TestZJIT < Test::Unit::TestCase
}, call_threshold: 2
end
+ def test_string_concat
+ assert_compiles '"123"', %q{
+ def test = "#{1}#{2}#{3}"
+
+ test
+ }, insns: [:concatstrings]
+ end
+
+ def test_string_concat_empty
+ assert_compiles '""', %q{
+ def test = "#{}"
+
+ test
+ }, insns: [:concatstrings]
+ end
+
private
# Assert that every method call in `test_script` can be compiled by ZJIT