Skip to main content

Testing

Unit and integration tests

The Go suite covers language detection, scanner exclusions and .gitignore, cache persistence and pruning, parser/tree wrappers, Markdown snapshots, CLI subprocess behavior, and engine runs. Run it with:

go test ./...

For the repository's CI-equivalent race check, run:

go test ./... -race -count=1 -coverprofile=coverage.out
go tool cover -func=coverage.out

Fixtures live under testdata/; output snapshots are under testdata/snapshots/. A passing suite verifies the tested behavior and fixtures, not arbitrary source grammars or every operating-system toolchain.

Local build and benchmarks

make build
make bench

make build writes bin/sunset. make bench runs Go benchmarks with memory statistics. Use benchmark results as measurements for the fixture and machine used; they are not a support guarantee.

Documentation checks

From the repository root, install the site dependencies and run the same checks used by the documentation workflow:

npm ci --prefix website
node scripts/validate-docs.mjs --root .
npm run build --prefix website

The documentation validator checks metadata, required pages, sidebar links, source-claim paths, markers, generated boilerplate, private endpoints, and recognizable secrets. The build check confirms Docusaurus can render the site.