Documentation
¶
Overview ¶
Package runner provides shared conformance-fixture test helpers.
Index ¶
- func ByteDiff(want, got []byte) string
- func CanonicalJSON(data []byte) ([]byte, error)
- func CanonicalJSONLexemes(data []byte) ([]byte, error)
- func DecodeJSONLines(data []byte) ([]json.RawMessage, error)
- func FixtureRoot() string
- func LoadJSON(t testing.TB, family, name string, target any)
- func LoadJSONLines(t testing.TB, family, name string) []json.RawMessage
- func ReadFixture(family, name string) ([]byte, error)
- func ReplacePathAliases(value, path, replacement string) string
- type Manifest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalJSON ¶
CanonicalJSON normalizes insignificant JSON whitespace and object-key order.
func CanonicalJSONLexemes ¶
CanonicalJSONLexemes sorts object keys while retaining scalar JSON spellings. It is used for wire fixtures where "<" and "\u003c", or 1 and 1.0, are semantically equal JSON but observably different protocol bytes.
func DecodeJSONLines ¶
func DecodeJSONLines(data []byte) ([]json.RawMessage, error)
DecodeJSONLines validates strict LF-delimited JSONL and returns the original line bytes. Each line must contain exactly one JSON value and the stream must end immediately after a final LF.
func FixtureRoot ¶
func FixtureRoot() string
FixtureRoot returns the absolute path to the committed fixture tree.
func LoadJSONLines ¶
func LoadJSONLines(t testing.TB, family, name string) []json.RawMessage
LoadJSONLines loads and validates one JSONL fixture or fails the calling test.
func ReadFixture ¶
ReadFixture reads one file from a fixture family.
func ReplacePathAliases ¶
ReplacePathAliases replaces both a path and its realpath alias.