Move -test-/fatal/rb_fatal to -test-/fatal

This commit is contained in:
Nobuyoshi Nakada 2024-03-24 01:09:29 +09:00
parent 5a77397489
commit 678cb80033
No known key found for this signature in database
GPG key ID: 3582D74E1FEE4465
4 changed files with 14 additions and 4 deletions

View file

@ -1,2 +1,3 @@
# frozen_string_literal: false # frozen_string_literal: false
create_makefile("-test-/fatal/rb_fatal") require_relative "../auto_ext.rb"
auto_ext

10
ext/-test-/fatal/init.c Normal file
View file

@ -0,0 +1,10 @@
#include "ruby.h"
#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);}
void
Init_fatal(void)
{
VALUE klass = rb_define_module("Bug");
TEST_INIT_FUNCS(init);
}

View file

@ -13,8 +13,7 @@ ruby_fatal(VALUE obj, VALUE msg)
} }
void void
Init_rb_fatal(void) Init_rb_fatal(VALUE mBug)
{ {
VALUE mBug = rb_define_module("Bug");
rb_define_singleton_method(mBug, "rb_fatal", ruby_fatal, 1); rb_define_singleton_method(mBug, "rb_fatal", ruby_fatal, 1);
} }

View file

@ -424,7 +424,7 @@ class TestFiber < Test::Unit::TestCase
end end
def test_fatal_in_fiber def test_fatal_in_fiber
assert_in_out_err(["-r-test-/fatal/rb_fatal", "-e", <<-EOS], "", [], /ok/) assert_in_out_err(["-r-test-/fatal", "-e", <<-EOS], "", [], /ok/)
Fiber.new{ Fiber.new{
Bug.rb_fatal "ok" Bug.rb_fatal "ok"
}.resume }.resume