Documentation
¶
Overview ¶
Package scantest exposes utilities for testing the codescan packages.
Index ¶
- func AssertArrayProperty(t *testing.T, schema *oaispec.Schema, ...)
- func AssertArrayRef(t *testing.T, schema *oaispec.Schema, jsonName, goName, fragment string)
- func AssertProperty(t *testing.T, schema *oaispec.Schema, ...)
- func AssertRef(t *testing.T, schema *oaispec.Schema, jsonName, _, fragment string)
- func CompareOrDumpJSON(t *testing.T, got any, name string)
- func FixturesDir() string
- func LoadClassificationPkgsCtx(t *testing.T) *scanner.ScanCtx
- func LoadGo118ClassificationPkgsCtx(t *testing.T) *scanner.ScanCtx
- func LoadPetstorePkgsCtx(t testing.TB, enableDebug bool) *scanner.ScanCtx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertArrayProperty ¶
func AssertArrayRef ¶
func AssertProperty ¶
func CompareOrDumpJSON ¶
CompareOrDumpJSON marshals got to stable JSON and either writes it to <repo>/fixtures/integration/golden/<name> (when UPDATE_GOLDEN=1) or asserts that it JSON-equals the stored golden.
This is the regression-testing harness used to detect any behavior change in the go-openapi/spec objects produced by the scanner, compared against a captured baseline.
Golden files are named by content (fixture bundle + object kind + entity), not by test name, so they survive test reshuffling.
func FixturesDir ¶
func FixturesDir() string
FixturesDir returns the absolute path to the repo-level fixtures/ directory, so tests can run from any package depth without fragile relative paths.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mocks contains mock types for all interfaces.
|
Package mocks contains mock types for all interfaces. |