Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion test/test_rdoc_parser_c.rb
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def test_find_body_document_method

baz = methods.last
assert_equal 'Foo#baz', baz.full_name
assert_equal "a comment for bar", bar.comment
assert_equal "a comment for bar", baz.comment
end

def test_find_modifiers_call_seq
Expand Down Expand Up @@ -911,6 +911,37 @@ def test_define_method
{
}

void
Init_IO(void) {
/*
* a comment for class Foo on rb_define_class
*/
VALUE rb_cIO = rb_define_class("IO", rb_cObject);
rb_define_singleton_method(rb_cIO, "read", rb_io_s_read, -1);
}
EOF

klass = util_get_class content, 'rb_cIO'
read_method = klass.method_list.first
assert_equal "read", read_method.name
assert_equal "Method Comment! ", read_method.comment
assert_equal "rb_io_s_read", read_method.c_function
assert read_method.singleton
end

def test_define_method_with_prototype
content = <<-EOF
static VALUE rb_io_s_read(int, VALUE*, VALUE);

/*Method Comment! */
static VALUE
rb_io_s_read(argc, argv, io)
int argc;
VALUE *argv;
VALUE io;
{
}

void
Init_IO(void) {
/*
Expand Down