Skip to content

Commit a7780af

Browse files
committed
Add failing test case for Rdoc::Parser::C.
This was causing rdoc to miss documentation on some parts of ruby implemented in C, for example zlib.c and win32ole.c.
1 parent 145d95d commit a7780af

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/test_rdoc_parser_c.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,37 @@ def test_define_method
911911
{
912912
}
913913
914+
void
915+
Init_IO(void) {
916+
/*
917+
* a comment for class Foo on rb_define_class
918+
*/
919+
VALUE rb_cIO = rb_define_class("IO", rb_cObject);
920+
rb_define_singleton_method(rb_cIO, "read", rb_io_s_read, -1);
921+
}
922+
EOF
923+
924+
klass = util_get_class content, 'rb_cIO'
925+
read_method = klass.method_list.first
926+
assert_equal "read", read_method.name
927+
assert_equal "Method Comment! ", read_method.comment
928+
assert_equal "rb_io_s_read", read_method.c_function
929+
assert read_method.singleton
930+
end
931+
932+
def test_define_method_with_prototype
933+
content = <<-EOF
934+
static VALUE rb_io_s_read(int, VALUE*, VALUE);
935+
936+
/*Method Comment! */
937+
static VALUE
938+
rb_io_s_read(argc, argv, io)
939+
int argc;
940+
VALUE *argv;
941+
VALUE io;
942+
{
943+
}
944+
914945
void
915946
Init_IO(void) {
916947
/*

0 commit comments

Comments
 (0)