diff options
author | Mike Dalessio <mike.dalessio@gmail.com> | 2021-10-11 16:46:27 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-10-16 01:39:04 +0900 |
commit | 9225f3c1c6304904a33ffaa608c77424441621e9 (patch) | |
tree | ff66358051f479db4ea448ef27557681a38b69d9 | |
parent | 19beb028e70d6e6893b0fb1107eb95428256588b (diff) |
[ruby/rdoc] test: add coverage for comment format in a C file
https://github.com/ruby/rdoc/commit/3b8334a796
-rw-r--r-- | test/rdoc/test_rdoc_parser_c.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_parser_c.rb b/test/rdoc/test_rdoc_parser_c.rb index 6601d28f60..41001be22c 100644 --- a/test/rdoc/test_rdoc_parser_c.rb +++ b/test/rdoc/test_rdoc_parser_c.rb @@ -1930,6 +1930,22 @@ void d(void) { @store.all_classes_and_modules.map { |m| m.full_name }.sort end + def test_markup_format_default + content = <<-EOF +void Init_Blah(void) { + cBlah = rb_define_class("Blah", rb_cObject); + + /* + * This should be interpreted in the default format. + */ + rb_attr(cBlah, rb_intern("default_format"), 1, 1, Qfalse); +} + EOF + + klass = util_get_class content, 'cBlah' + assert_equal("rdoc", klass.attributes.find {|a| a.name == "default_format"}.comment.format) + end + def util_get_class content, name = nil @parser = util_parser content @parser.scan |