diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-28 22:08:56 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-28 22:08:56 +0000 |
commit | e2efe8e81dc7e9fce40b024df6a20bbf4b830350 (patch) | |
tree | 942e66e071e759c7db670a42daeac26c7437f25b /test/rdoc/test_rdoc_parser_c.rb | |
parent | 90d5bcf9104fe58887cf705b718a9c7b537b51a5 (diff) |
Import RDoc 3.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 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 | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_parser_c.rb b/test/rdoc/test_rdoc_parser_c.rb index c6cc42081c..dd856c1bcf 100644 --- a/test/rdoc/test_rdoc_parser_c.rb +++ b/test/rdoc/test_rdoc_parser_c.rb @@ -532,6 +532,46 @@ Init_Foo(void) { assert_equal "VALUE\nother_function() ", code end + def test_find_body_2 + content = <<-CONTENT +/* Copyright (C) 2010 Sven Herzberg + * + * This file is free software; the author(s) gives unlimited + * permission to copy and/or distribute it, with or without + * modifications, as long as this notice is preserved. + */ + +#include <ruby.h> + +static VALUE +wrap_initialize (VALUE self) +{ + return self; +} + +/* */ +static VALUE +wrap_shift (VALUE self, + VALUE arg) +{ + return self; +} + +void +init_gi_repository (void) +{ + VALUE mTest = rb_define_module ("Test"); + VALUE cTest = rb_define_class_under (mTest, "Test", rb_cObject); + + rb_define_method (cTest, "initialize", wrap_initialize, 0); + rb_define_method (cTest, "shift", wrap_shift, 0); +} + CONTENT + + klass = util_get_class content, 'cTest' + assert_equal 2, klass.method_list.length + end + def test_find_body_define content = <<-EOF /* @@ -633,6 +673,31 @@ commercial(cwyear, cweek=1, cwday=1, sg=nil) -> Date [ruby 1.9] assert_equal expected, method_obj.call_seq end + def test_find_modifiers_call_seq_no_blank + comment = <<-COMMENT +/* call-seq: + * commercial() -> Date <br /> + * commercial(cwyear, cweek=41, cwday=5, sg=nil) -> Date [ruby 1.8] <br /> + * commercial(cwyear, cweek=1, cwday=1, sg=nil) -> Date [ruby 1.9] + */ + + COMMENT + + parser = util_parser '' + method_obj = RDoc::AnyMethod.new nil, 'blah' + + parser.find_modifiers comment, method_obj + + expected = <<-CALL_SEQ.chomp +commercial() -> Date <br /> +commercial(cwyear, cweek=41, cwday=5, sg=nil) -> Date [ruby 1.8] <br /> +commercial(cwyear, cweek=1, cwday=1, sg=nil) -> Date [ruby 1.9] + + CALL_SEQ + + assert_equal expected, method_obj.call_seq + end + def test_find_modifiers_nodoc comment = <<-COMMENT /* :nodoc: |