Merge pull request #41 from blackducksw/ubuntu_14
[ohcount] / test / unit / parsers / test_d.h
1
2 void test_dmd_comments() {
3   test_parser_verify_parse(
4     test_parser_sourcefile("dmd", " //comment"),
5     "dmd", "", "//comment", 0
6   );
7 }
8
9 void test_dmd_empty_comments() {
10   test_parser_verify_parse(
11     test_parser_sourcefile("dmd", " //\n"),
12     "dmd", "", "//\n", 0
13   );
14 }
15
16 void test_dmd_strings() {
17   test_parser_verify_parse(
18     test_parser_sourcefile("dmd", "'/*' not a comment '*/'"),
19     "dmd", "'/*' not a comment '*/'", "", 0
20   );
21 }
22
23 void test_dmd_block_comment() {
24   test_parser_verify_parse(
25     test_parser_sourcefile("dmd", " /*d*/"),
26     "dmd", "", "/*d*/", 0
27   );
28   test_parser_verify_parse(
29     test_parser_sourcefile("dmd", " /+d+/"),
30     "dmd", "", "/+d+/", 0
31   );
32 }
33
34 void test_dmd_nested_block_comment() {
35   test_parser_verify_parse(
36     test_parser_sourcefile("dmd", "/+ /*d*/ not_code(); +/"),
37     "dmd", "", "/+ /*d*/ not_code(); +/", 0
38   );
39 }
40
41 void test_dmd_comment_entities() {
42   test_parser_verify_entity(
43     test_parser_sourcefile("dmd", " //comment"),
44     "comment", "//comment"
45   );
46   test_parser_verify_entity(
47     test_parser_sourcefile("dmd", " /*comment*/"),
48     "comment", "/*comment*/"
49   );
50   test_parser_verify_entity(
51     test_parser_sourcefile("dmd", " /+comment+/"),
52     "comment", "/+comment+/"
53   );
54 }
55
56 void all_dmd_tests() {
57   test_dmd_comments();
58   test_dmd_empty_comments();
59   test_dmd_strings();
60   test_dmd_block_comment();
61   test_dmd_nested_block_comment();
62   test_dmd_comment_entities();
63 }