From dc8c5bafcf3afe478710a8f93b8638fcbf510f1f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 23 Dec 2022 06:06:31 +0900 Subject: [PATCH] Clean intermediate source file in `TestMJIT#test_jit_failure` (#6994) --- test/ruby/test_mjit.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/ruby/test_mjit.rb b/test/ruby/test_mjit.rb index bf4046b220..c616ac2313 100644 --- a/test/ruby/test_mjit.rb +++ b/test/ruby/test_mjit.rb @@ -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