Missing: no test corpus — tree-sitter test reports zero coverage #20
Clément DELALANDE opened 2 days ago

Summary

There is no test corpus. tree-sitter test reports zero coverage:

$ tree-sitter test
Warning: Test corpus not found at .../tree-sitter-gate/test/corpus
Total parses: 0; successful parses: 0; failed parses: 0; success percentage: N/A

The only test (bindings/node/binding_test.js) asserts that the grammar loads, not that it parses correctly:

test("can load grammar", async () => {
  const parser = new Parser();
  await assert.doesNotReject(async () => {
    const { default: language } = await import("./index.js");
    parser.setLanguage(language);
  });
});

There is no regression safety net, so grammar changes can silently break parsing.

Expected

  • Create test/corpus/ with one file per feature: declarations, variables, functions, expressions, types, collections, comments, f-strings.
  • Add corpus entries mirroring examples/Plain.gate, examples/Weapon.gate, examples/all.gate so tree-sitter test gates parsing.
  • Add a parse-fidelity test in bindings/node/binding_test.js asserting expected node types/fields for representative snippets.

Files

  • test/corpus/ (new)
  • bindings/node/binding_test.js
1/1
Type
Improvement
Priority
Normal
Assignees
Not assigned
Issue Votes (0)
Watchers (1)
Reference
gate/tree-sitter-gate#20
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover