Skip to content

Commit 3b8334a

Browse files
committed
test: add coverage for comment format in a C file
1 parent 490e46e commit 3b8334a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/rdoc/test_rdoc_parser_c.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,6 +1930,22 @@ def test_scan_order_dependent
19301930
@store.all_classes_and_modules.map { |m| m.full_name }.sort
19311931
end
19321932

1933+
def test_markup_format_default
1934+
content = <<-EOF
1935+
void Init_Blah(void) {
1936+
cBlah = rb_define_class("Blah", rb_cObject);
1937+
1938+
/*
1939+
* This should be interpreted in the default format.
1940+
*/
1941+
rb_attr(cBlah, rb_intern("default_format"), 1, 1, Qfalse);
1942+
}
1943+
EOF
1944+
1945+
klass = util_get_class content, 'cBlah'
1946+
assert_equal("rdoc", klass.attributes.find {|a| a.name == "default_format"}.comment.format)
1947+
end
1948+
19331949
def util_get_class content, name = nil
19341950
@parser = util_parser content
19351951
@parser.scan

0 commit comments

Comments
 (0)