Merge pull request #41 from blackducksw/ubuntu_14
[ohcount] / test / unit / parsers / test_nsis.h
1
2 void test_nsis_comments() {
3   test_parser_verify_parse(
4     test_parser_sourcefile("nsis", " ;comment"),
5     "nsis", "", ";comment", 0
6   );
7   test_parser_verify_parse(
8     test_parser_sourcefile("nsis", " #comment"),
9     "nsis", "", "#comment", 0
10   );
11   test_parser_verify_parse(
12     test_parser_sourcefile("nsis", " /*comment*/"),
13     "nsis", "", "/*comment*/", 0
14   );
15 }
16
17 void test_nsis_strings() {
18   test_parser_verify_parse(
19     test_parser_sourcefile("nsis", "\"abc;not a 'comment\""),
20     "nsis", "\"abc;not a 'comment\"", "", 0
21   );
22   test_parser_verify_parse(
23     test_parser_sourcefile("nsis", "'abc;not a \"comment'"),
24     "nsis", "'abc;not a \"comment'", "", 0
25   );
26   test_parser_verify_parse(
27     test_parser_sourcefile("nsis", "`abc;not a 'comment`"),
28     "nsis", "`abc;not a 'comment`", "", 0
29   );
30 }
31
32 void test_nsis_comment_entities() {
33   test_parser_verify_entity(
34     test_parser_sourcefile("nsis", " ;comment"),
35     "comment", ";comment"
36   );
37   test_parser_verify_entity(
38     test_parser_sourcefile("nsis", " #comment"),
39     "comment", "#comment"
40   );
41   test_parser_verify_entity(
42     test_parser_sourcefile("nsis", " /*comment*/"),
43     "comment", "/*comment*/"
44   );
45 }
46
47 void all_nsis_tests() {
48   test_nsis_comments();
49   test_nsis_strings();
50   test_nsis_comment_entities();
51 }