diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-14 00:39:16 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-14 00:39:16 +0000 |
commit | 0b6da24a5e24ff9ce8e153d2f073c2363e94b28e (patch) | |
tree | 95eb233fee15aae2fa2ba7dbeb1bb9c7bdfd9e1d /test/rdoc/test_rdoc_parser_c.rb | |
parent | fe89874540f5e95fbfd933a72fff2ad31b8e8d07 (diff) |
* lib/rdoc.rb: Updated to RDoc 3.6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_parser_c.rb')
-rw-r--r-- | test/rdoc/test_rdoc_parser_c.rb | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/test/rdoc/test_rdoc_parser_c.rb b/test/rdoc/test_rdoc_parser_c.rb index 6a3a92001a..9649933fd0 100644 --- a/test/rdoc/test_rdoc_parser_c.rb +++ b/test/rdoc/test_rdoc_parser_c.rb @@ -680,7 +680,7 @@ Init_Foo(void) { 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 @@ -929,6 +929,37 @@ Init_IO(void) { 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) { + /* + * 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_private content = <<-EOF /*Method Comment! */ |