Add insn tests for newarraykwsplat
This commit is contained in:
parent
e13da00824
commit
1a5a01e9ce
@ -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 }, ],
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user