Codebase list ohcount / dfcc369c-a8fa-4697-8331-c0472835aae2/main test / unit / parsers / test_nsis.h
dfcc369c-a8fa-4697-8331-c0472835aae2/main

Tree @dfcc369c-a8fa-4697-8331-c0472835aae2/main (Download .tar.gz)

test_nsis.h @dfcc369c-a8fa-4697-8331-c0472835aae2/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();
}