scripts/sqlc-unused counts a call from a package covered by a ".*" entry of scripts/deadcode-testonly.txt as a test use, so one list defines the test-support packages for both checks, and the list's header says so. A query that only the kit's builders call now reads TEST-ONLY, not used. The check reads the module in a directory it is given, which lets a test run it over a fixture module. New tests: TestScanCountsATestSupportPackageAsTestUse, over a fixture module whose kit package and app package each call one query, and TestReadSupportTakesTheWholePackageEntries. The other tests, TestCheck and TestReadAllow, are unchanged. The output of go run ./scripts/sqlc-unused equals the baseline taken before step 2 once each line's count of test references is stripped. 2 breaks, each failed the new tests; they have no old side.
4 lines
37 B
AMPL
4 lines
37 B
AMPL
module example.test/fixture
|
|
|
|
go 1.22
|