mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby/test_jit.rb: Add a test for checkmatch insn
This commit is contained in:
parent
5bcef26d24
commit
1c0c8d5da2
1 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue