mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 22:14:37 +02:00
Move -test-/fatal/rb_fatal
to -test-/fatal
This commit is contained in:
parent
5a77397489
commit
678cb80033
4 changed files with 14 additions and 4 deletions
|
@ -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
10
ext/-test-/fatal/init.c
Normal 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);
|
||||||
|
}
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue