WireGolden

object WireGolden

Byte-for-byte comparison against a committed golden file.

A golden file holds the exact text under test followed by one newline. A missing file fails the test: the v9 wire goldens are frozen contracts, so they are only (re)written on purpose, by running the test with WOW_GOLDEN_UPDATE=true and reviewing the diff together with the design decision that allows it.

Properties

Link copied to clipboard
const val UPDATE_ENV: String

Functions

Link copied to clipboard
fun assertMatches(name: String, actual: String)

Asserts actual equals the golden file byte for byte, or rewrites the file when UPDATE_ENV is true.

Link copied to clipboard
fun path(name: String): Path

Golden files live under the module's src/test/resources/wire/v9/.

Link copied to clipboard
fun read(name: String): String

Returns the golden text (without the trailing newline).