Codebase list ohcount / 81a9b407-9b9f-4b49-8972-ed3f6d30059f/main test / unit / parsers / test_nsis.h
81a9b407-9b9f-4b49-8972-ed3f6d30059f/main

Tree @81a9b407-9b9f-4b49-8972-ed3f6d30059f/main (Download .tar.gz)

test_nsis.h @81a9b407-9b9f-4b49-8972-ed3f6d30059f/mainraw · history · blame

void test_nsis_comments() {
  test_parser_verify_parse(
    test_parser_sourcefile("nsis", " ;comment"),
    "nsis", "", ";comment", 0
  );
  test_parser_verify_parse(
    test_parser_sourcefile("nsis", " #comment"),
    "nsis", "", "#comment", 0
  );
  test_parser_verify_parse(
    test_parser_sourcefile("nsis", " /*comment*/"),
    "nsis", "", "/*comment*/", 0
  );
}

void test_nsis_strings() {
  test_parser_verify_parse(
    test_parser_sourcefile("nsis", "\"abc;not a 'comment\""),
    "nsis", "\"abc;not a 'comment\"", "", 0
  );
  test_parser_verify_parse(
    test_parser_sourcefile("nsis", "'abc;not a \"comment'"),
    "nsis", "'abc;not a \"comment'", "", 0
  );
  test_parser_verify_parse(
    test_parser_sourcefile("nsis", "`abc;not a 'comment`"),
    "nsis", "`abc;not a 'comment`", "", 0
  );
}

void test_nsis_comment_entities() {
  test_parser_verify_entity(
    test_parser_sourcefile("nsis", " ;comment"),
    "comment", ";comment"
  );
  test_parser_verify_entity(
    test_parser_sourcefile("nsis", " #comment"),
    "comment", "#comment"
  );
  test_parser_verify_entity(
    test_parser_sourcefile("nsis", " /*comment*/"),
    "comment", "/*comment*/"
  );
}

void all_nsis_tests() {
  test_nsis_comments();
  test_nsis_strings();
  test_nsis_comment_entities();
}