diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-08-18 11:37:54 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-08-18 14:57:08 +0900 |
commit | 725626d8905fe1ac4a2cf1c3e2db6412bf8f381f (patch) | |
tree | 7cae7468c03688405b2a6fa6cfe5af21fb599f7e /ext/-test- | |
parent | 2a55c61ee77df55e8715809958ea0439f3918cf2 (diff) | |
download | ruby-725626d8905fe1ac4a2cf1c3e2db6412bf8f381f.tar.gz |
[Bug #18964] Update the code range of appended portion
Diffstat (limited to 'ext/-test-')
-rw-r--r-- | ext/-test-/econv/append.c | 15 | ||||
-rw-r--r-- | ext/-test-/econv/extconf.rb | 3 | ||||
-rw-r--r-- | ext/-test-/econv/init.c | 11 |
3 files changed, 29 insertions, 0 deletions
diff --git a/ext/-test-/econv/append.c b/ext/-test-/econv/append.c new file mode 100644 index 0000000000..724cd136c0 --- /dev/null +++ b/ext/-test-/econv/append.c @@ -0,0 +1,15 @@ +#include "ruby/ruby.h" +#include "ruby/encoding.h" + +static VALUE +econv_append(VALUE self, VALUE src, VALUE dst) +{ + rb_econv_t *ec = DATA_PTR(self); + return rb_econv_str_append(ec, src, dst, 0); +} + +void +Init_econv_append(VALUE klass) +{ + rb_define_method(klass, "append", econv_append, 2); +} diff --git a/ext/-test-/econv/extconf.rb b/ext/-test-/econv/extconf.rb new file mode 100644 index 0000000000..d786b15db9 --- /dev/null +++ b/ext/-test-/econv/extconf.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: false +require_relative "../auto_ext.rb" +auto_ext(inc: true) diff --git a/ext/-test-/econv/init.c b/ext/-test-/econv/init.c new file mode 100644 index 0000000000..9772ebe71c --- /dev/null +++ b/ext/-test-/econv/init.c @@ -0,0 +1,11 @@ +#include "ruby.h" + +#define init(n) {void Init_econv_##n(VALUE klass); Init_econv_##n(klass);} + +void +Init_econv(void) +{ + VALUE mBug = rb_define_module("Bug"); + VALUE klass = rb_define_class_under(mBug, "EConv", rb_path2class("Encoding::Converter")); + TEST_INIT_FUNCS(init); +} |