Codebase list ohcount / 6ef9399e-69b6-464b-98a8-52915e284046/upstream test / unit / parsers / test_golang.h
6ef9399e-69b6-464b-98a8-52915e284046/upstream

Tree @6ef9399e-69b6-464b-98a8-52915e284046/upstream (Download .tar.gz)

test_golang.h @6ef9399e-69b6-464b-98a8-52915e284046/upstreamraw · history · blame

void test_golang_comments() {
  test_parser_verify_parse(
    test_parser_sourcefile("go", " //comment"),
    "go", "", "//comment", 0
  );
}

void test_golang_empty_comments() {
  test_parser_verify_parse(
    test_parser_sourcefile("go", " //\n"),
    "go", "", "//\n", 0
  );
}

void test_golang_block_comment() {
  test_parser_verify_parse(
    test_parser_sourcefile("go", "/*c*/"),
    "go", "", "/*c*/", 0
  );
}

void test_golang_comment_entities() {
  test_parser_verify_entity(
    test_parser_sourcefile("go", " //comment"),
    "comment", "//comment"
  );
  test_parser_verify_entity(
    test_parser_sourcefile("go", " /*comment*/"),
    "comment", "/*comment*/"
  );
}

void all_golang_tests() {
  test_golang_comments();
  test_golang_empty_comments();
  test_golang_block_comment();
  test_golang_comment_entities();
}