Skip to content

Commit a515fee

Browse files
committed
Add rb_dummy_tests_rb_ary_push
1 parent b27be97 commit a515fee

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

testdata/dummy/ext/dummy/tests.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ VALUE rb_dummy_tests_rb_eval_string(VALUE self, VALUE str);
2121
VALUE rb_dummy_tests_rb_eval_string_protect(VALUE self, VALUE str);
2222
VALUE rb_dummy_tests_rb_ary_new(VALUE self);
2323
VALUE rb_dummy_tests_rb_ary_new_capa(VALUE self, VALUE capa);
24+
VALUE rb_dummy_tests_rb_ary_push(VALUE self, VALUE ary, VALUE elem);
2425
*/
2526
import "C"
2627

@@ -194,6 +195,13 @@ func rb_dummy_tests_rb_ary_new_capa(_ C.VALUE, capa C.VALUE) C.VALUE {
194195
return C.VALUE(ret)
195196
}
196197

198+
//export rb_dummy_tests_rb_ary_push
199+
func rb_dummy_tests_rb_ary_push(_ C.VALUE, ary C.VALUE, elem C.VALUE) C.VALUE {
200+
ret := ruby.RbAryPush(ruby.VALUE(ary), ruby.VALUE(elem))
201+
202+
return C.VALUE(ret)
203+
}
204+
197205
// defineMethodsToDummyTests define methods in Dummy::Tests
198206
func defineMethodsToDummyTests(rb_mDummy ruby.VALUE) {
199207
rb_cTests := ruby.RbDefineClassUnder(rb_mDummy, "Tests", ruby.VALUE(C.rb_cObject))
@@ -217,4 +225,5 @@ func defineMethodsToDummyTests(rb_mDummy ruby.VALUE) {
217225
ruby.RbDefineSingletonMethod(rb_cTests, "rb_eval_string_protect", C.rb_dummy_tests_rb_eval_string_protect, 1)
218226
ruby.RbDefineSingletonMethod(rb_cTests, "rb_ary_new", C.rb_dummy_tests_rb_ary_new, 0)
219227
ruby.RbDefineSingletonMethod(rb_cTests, "rb_ary_new_capa", C.rb_dummy_tests_rb_ary_new_capa, 1)
228+
ruby.RbDefineSingletonMethod(rb_cTests, "rb_ary_push", C.rb_dummy_tests_rb_ary_push, 2)
220229
}

0 commit comments

Comments
 (0)