diff options
-rw-r--r-- | bootstraptest/test_insns.rb | 1 | ||||
-rw-r--r-- | test/ruby/test_jit.rb | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/bootstraptest/test_insns.rb b/bootstraptest/test_insns.rb index fe0b01a97e..9deb57cf23 100644 --- a/bootstraptest/test_insns.rb +++ b/bootstraptest/test_insns.rb @@ -95,6 +95,7 @@ tests = [ [ 'intern', %q{ :"#{true}" }, ], [ 'newarray', %q{ ["true"][0] }, ], + [ 'newarraykwsplat', %q{ [**{x:'true'}][0][:x] }, ], [ 'duparray', %q{ [ true ][0] }, ], [ 'expandarray', %q{ y = [ true, false, nil ]; x, = y; x }, ], [ 'expandarray', %q{ y = [ true, false, nil ]; x, *z = y; x }, ], diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 453290d2f0..1c1a07c944 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -248,6 +248,10 @@ class TestJIT < Test::Unit::TestCase end; end + def test_compile_insn_newarraykwsplat + assert_compile_once('[**{ x: 1 }]', result_inspect: '[{:x=>1}]', insns: %i[newarraykwsplat]) + end + def test_compile_insn_intern_duparray assert_compile_once('[:"#{0}"] + [1,2,3]', result_inspect: '[:"0", 1, 2, 3]', insns: %i[intern duparray]) end |