[前][次][番号順一覧][スレッド一覧]

ruby-changes:57501

From: Takashi <ko1@a...>
Date: Tue, 3 Sep 2019 01:39:17 +0900 (JST)
Subject: [ruby-changes:57501] 1a5a01e9ce (master): Add insn tests for newarraykwsplat

https://git.ruby-lang.org/ruby.git/commit/?id=1a5a01e9ce

From 1a5a01e9ce9bf69944e4e37a33c8b044657a200a Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Tue, 3 Sep 2019 01:39:00 +0900
Subject: Add insn tests for newarraykwsplat


diff --git a/bootstraptest/test_insns.rb b/bootstraptest/test_insns.rb
index fe0b01a..9deb57c 100644
--- a/bootstraptest/test_insns.rb
+++ b/bootstraptest/test_insns.rb
@@ -95,6 +95,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L95
   [ '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 453290d..1c1a07c 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -248,6 +248,10 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L248
     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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]