From 1c0c8d5da2abc84a56ca4b66b73e0c262df0fbbe Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Mon, 25 Oct 2021 21:30:16 +0900 Subject: test/ruby/test_jit.rb: Add a test for checkmatch insn --- test/ruby/test_jit.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index b1bef2a7b7..669dcf56e6 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -609,6 +609,17 @@ class TestJIT < Test::Unit::TestCase assert_eval_with_jit('print "\x00".unpack("c")', stdout: '[0]', success_count: 1) end + def test_compile_insn_checkmatch + assert_compile_once("#{<<~"begin;"}\n#{<<~"end;"}", result_inspect: '"world"', insns: %i[checkmatch]) + begin; + ary = %w(hello good-bye) + case 'hello' + when *ary + 'world' + end + end; + end + def test_jit_output out, err = eval_with_jit('5.times { puts "MJIT" }', verbose: 1, min_calls: 5) assert_equal("MJIT\n" * 5, out) -- cgit v1.2.3