Files
member-console/scripts/sqlc-unused/testdata/fixture/kit/kit.go
T
cgalo5758 254bc4ccb1 Count the test kit's query calls as test uses
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.
2026-10-08 00:52:30 -05:00

11 lines
298 B
Go

// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
// SPDX-FileCopyrightText: 2025-2026 Christian Galo
// Package kit stands in for a test-support package: it calls a query.
package kit
import "example.test/fixture/db"
// Seed calls Probe.
func Seed(q *db.Queries) { q.Probe() }