Clean intermediate source file in TestMJIT#test_jit_failure (#6994)

This commit is contained in:
Nobuyoshi Nakada 2022-12-23 06:06:31 +09:00 committed by GitHub
parent 7e8fa06022
commit dc8c5bafcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2022-12-22 21:06:49 +00:00
Merged-By: k0kubun <takashikkbn@gmail.com>

View File

@ -1197,13 +1197,15 @@ class TestMJIT < Test::Unit::TestCase
end
def test_jit_failure
_, err = eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", call_threshold: 2, verbose: 1)
begin;
2.times do
class A
_, err = Dir.mktmpdir("jit_test_jit_failure") do |dir|
eval_with_jit({"TMPDIR"=>dir}, "#{<<~"begin;"}\n#{<<~"end;"}", call_threshold: 2, verbose: 1)
begin;
2.times do
class A
end
end
end
end;
end;
end
assert_match(/^MJIT warning: .+ unsupported instruction: defineclass/, err)
end