Skip to content

Commit c5d048d

Browse files
committed
Merge pull request #34 from phiggins/failing_test_case_for_parser_c
Failing test case for Rdoc::Parser::C for C methods with a prototype
2 parents 557ebe4 + a7780af commit c5d048d

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

test/test_rdoc_parser_c.rb

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ def test_find_body_document_method
680680

681681
baz = methods.last
682682
assert_equal 'Foo#baz', baz.full_name
683-
assert_equal "a comment for bar", bar.comment
683+
assert_equal "a comment for bar", baz.comment
684684
end
685685

686686
def test_find_modifiers_call_seq
@@ -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)