summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2026-01-02 11:05:07 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2026-01-09 17:16:22 +0900
commite01e13c23999f0e43d8a0874003c73a1cdd68f1e (patch)
tree2a1b010397692d0db959a5fcf77b5c7320f1c68d /test/ruby
parentfc0c67deb2195c51661b6c35eb41cfb2cb92e3f8 (diff)
Use `assert_ruby_status` if no assertion
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_autoload.rb8
-rw-r--r--test/ruby/test_gc_compact.rb2
-rw-r--r--test/ruby/test_lambda.rb2
-rw-r--r--test/ruby/test_module.rb4
-rw-r--r--test/ruby/test_optimization.rb4
-rw-r--r--test/ruby/test_process.rb4
-rw-r--r--test/ruby/test_require.rb4
-rw-r--r--test/ruby/test_shapes.rb6
-rw-r--r--test/ruby/test_signal.rb2
-rw-r--r--test/ruby/test_syntax.rb4
-rw-r--r--test/ruby/test_thread.rb7
-rw-r--r--test/ruby/test_weakmap.rb4
-rw-r--r--test/ruby/test_yield.rb2
-rw-r--r--test/ruby/test_yjit.rb2
14 files changed, 30 insertions, 25 deletions
diff --git a/test/ruby/test_autoload.rb b/test/ruby/test_autoload.rb
index 50949274a3..82bf2d9d2c 100644
--- a/test/ruby/test_autoload.rb
+++ b/test/ruby/test_autoload.rb
@@ -574,7 +574,7 @@ p Foo::Bar
autoload_path = File.join(tmpdir, "autoload_parallel_race.rb")
File.write(autoload_path, 'module Foo; end; module Bar; end')
- assert_separately([], <<-RUBY, timeout: 100)
+ assert_ruby_status([], <<-RUBY, timeout: 100)
autoload_path = #{File.realpath(autoload_path).inspect}
# This should work with no errors or failures.
@@ -617,6 +617,10 @@ p Foo::Bar
private
def assert_separately(*args, **kwargs)
- super(*args, **{ timeout: 60 }.merge(kwargs))
+ super(*args, timeout: 60, **kwargs)
+ end
+
+ def assert_ruby_status(*args, **kwargs)
+ super(*args, timeout: 60, **kwargs)
end
end
diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb
index bc7692d644..84828d4985 100644
--- a/test/ruby/test_gc_compact.rb
+++ b/test/ruby/test_gc_compact.rb
@@ -364,7 +364,7 @@ class TestGCCompact < Test::Unit::TestCase
def test_compact_objects_of_varying_sizes
omit if GC::INTERNAL_CONSTANTS[:SIZE_POOL_COUNT] == 1
- assert_separately([], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10)
+ assert_ruby_status([], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10)
begin;
$objects = []
160.times do |n|
diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb
index 6a0dd9915e..c1858a36dd 100644
--- a/test/ruby/test_lambda.rb
+++ b/test/ruby/test_lambda.rb
@@ -163,7 +163,7 @@ class TestLambdaParameters < Test::Unit::TestCase
end
def test_proc_inside_lambda_toplevel
- assert_separately [], <<~RUBY
+ assert_ruby_status [], <<~RUBY
lambda{
$g = proc{ return :pr }
}.call
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 3db60dec8f..9ed6c1e321 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -583,7 +583,7 @@ class TestModule < Test::Unit::TestCase
end
def test_gc_prepend_chain
- assert_separately([], <<-EOS)
+ assert_ruby_status([], <<-EOS)
10000.times { |i|
m1 = Module.new do
def foo; end
@@ -3073,7 +3073,7 @@ class TestModule < Test::Unit::TestCase
end
def test_prepend_gc
- assert_separately [], %{
+ assert_ruby_status [], %{
module Foo
end
class Object
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index cfa90b8b8a..5d16984eef 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -946,14 +946,14 @@ class TestRubyOptimization < Test::Unit::TestCase
end
def test_peephole_optimization_without_trace
- assert_separately [], <<-END
+ assert_ruby_status [], <<-END
RubyVM::InstructionSequence.compile_option = {trace_instruction: false}
eval "def foo; 1.times{|(a), &b| nil && a}; end"
END
end
def test_clear_unreachable_keyword_args
- assert_separately [], <<-END, timeout: 60
+ assert_ruby_status [], <<-END, timeout: 60
script = <<-EOS
if true
else
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 857ceab676..b3a88b664c 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1996,7 +1996,7 @@ class TestProcess < Test::Unit::TestCase
end
def test_popen_reopen
- assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ assert_ruby_status([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
io = File.open(IO::NULL)
io2 = io.dup
@@ -2387,7 +2387,7 @@ EOS
end
def test_deadlock_by_signal_at_forking
- assert_separately(%W(- #{RUBY}), <<-INPUT, timeout: 100)
+ assert_ruby_status(%W(- #{RUBY}), <<-INPUT, timeout: 100)
ruby = ARGV.shift
GC.start # reduce garbage
GC.disable # avoid triggering CoW after forks
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index bbec9a5f95..0067a49700 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -842,7 +842,7 @@ class TestRequire < Test::Unit::TestCase
}
# [Bug #21567]
- assert_separately(%w[-rtempfile], "#{<<~"begin;"}\n#{<<~"end;"}")
+ assert_ruby_status(%w[-rtempfile], "#{<<~"begin;"}\n#{<<~"end;"}")
begin;
class MyString
def initialize(path)
@@ -1029,7 +1029,7 @@ class TestRequire < Test::Unit::TestCase
def test_require_with_public_method_missing
# [Bug #19793]
- assert_separately(["-W0", "-rtempfile"], __FILE__, __LINE__, <<~RUBY, timeout: 60)
+ assert_ruby_status(["-W0", "-rtempfile"], <<~RUBY, timeout: 60)
GC.stress = true
class Object
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb
index 453ca8f6a7..67e2c543a3 100644
--- a/test/ruby/test_shapes.rb
+++ b/test/ruby/test_shapes.rb
@@ -228,7 +228,7 @@ class TestShapes < Test::Unit::TestCase
end
def test_run_out_of_shape_for_object
- assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ assert_ruby_status([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
class A
def initialize
@@ -339,7 +339,7 @@ class TestShapes < Test::Unit::TestCase
end
def test_gc_stress_during_evacuate_generic_ivar
- assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ assert_ruby_status([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
[].instance_variable_set(:@a, 1)
@@ -507,7 +507,7 @@ class TestShapes < Test::Unit::TestCase
end
def test_run_out_of_shape_rb_obj_copy_ivar
- assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ assert_ruby_status([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
class A
def initialize
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb
index 661ba03141..091a66d5da 100644
--- a/test/ruby/test_signal.rb
+++ b/test/ruby/test_signal.rb
@@ -333,7 +333,7 @@ class TestSignal < Test::Unit::TestCase
def test_sigwait_fd_unused
t = EnvUtil.apply_timeout_scale(0.1)
- assert_separately([], <<-End)
+ assert_ruby_status([], <<-End)
tgt = $$
trap(:TERM) { exit(0) }
e = "Process.daemon; sleep #{t * 2}; Process.kill(:TERM,\#{tgt})"
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 585e691765..b355128a73 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -2296,13 +2296,13 @@ eom
end
def test_class_module_Object_ancestors
- assert_separately([], <<-RUBY)
+ assert_ruby_status([], <<-RUBY)
m = Module.new
m::Bug18832 = 1
include m
class Bug18832; end
RUBY
- assert_separately([], <<-RUBY)
+ assert_ruby_status([], <<-RUBY)
m = Module.new
m::Bug18832 = 1
include m
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 8edebfb5c2..2a61fc3450 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -1594,7 +1594,8 @@ q.pop
# [Bug #21342]
def test_unlock_locked_mutex_with_collected_fiber
- assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ bug21127 = '[ruby-core:120930] [Bug #21127]'
+ assert_ruby_status([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
5.times do
m = Mutex.new
@@ -1611,7 +1612,7 @@ q.pop
end
def test_unlock_locked_mutex_with_collected_fiber2
- assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ assert_ruby_status([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
MUTEXES = []
5.times do
@@ -1630,7 +1631,7 @@ q.pop
end
def test_mutexes_locked_in_fiber_dont_have_aba_issue_with_new_fibers
- assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ assert_ruby_status([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
mutexes = 1000.times.map do
Mutex.new
diff --git a/test/ruby/test_weakmap.rb b/test/ruby/test_weakmap.rb
index 1050c74b3d..4f5823ecf4 100644
--- a/test/ruby/test_weakmap.rb
+++ b/test/ruby/test_weakmap.rb
@@ -203,7 +203,7 @@ class TestWeakMap < Test::Unit::TestCase
@wm[i] = obj
end
- assert_separately([], <<-'end;')
+ assert_ruby_status([], <<-'end;')
wm = ObjectSpace::WeakMap.new
obj = Object.new
100.times do
@@ -224,7 +224,7 @@ class TestWeakMap < Test::Unit::TestCase
assert_equal(val, wm[key])
end;
- assert_separately(["-W0"], <<-'end;')
+ assert_ruby_status(["-W0"], <<-'end;')
wm = ObjectSpace::WeakMap.new
ary = 10_000.times.map do
diff --git a/test/ruby/test_yield.rb b/test/ruby/test_yield.rb
index 9b2b2f37e0..e7e65fce9e 100644
--- a/test/ruby/test_yield.rb
+++ b/test/ruby/test_yield.rb
@@ -401,7 +401,7 @@ class TestRubyYieldGen < Test::Unit::TestCase
def test_block_cached_argc
# [Bug #11451]
- assert_separately([], <<-"end;")
+ assert_ruby_status([], <<-"end;")
class Yielder
def each
yield :x, :y, :z
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb
index 2096585451..6488661c2d 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -133,7 +133,7 @@ class TestYJIT < Test::Unit::TestCase
end
def test_yjit_enable_with_monkey_patch
- assert_separately(%w[--yjit-disable], <<~RUBY)
+ assert_ruby_status(%w[--yjit-disable], <<~RUBY)
# This lets rb_method_entry_at(rb_mKernel, ...) return NULL
Kernel.prepend(Module.new)