Documentation ¶
Overview ¶
Package difftests provides utilities for writing tests that compare against golden output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestCase ¶
type TestCase struct { Name string // contains filtered or unexported fields }
TestCase provides methods load and save data for a diff test.
func DiscoverTestCases ¶
DiscoverTestCases discovers test cases for expectation tests.
DiscoverTestCases assumes the following filesystem layout under `root`: - Input files, named ${root}/**/*.input, contain the input protobuf payload. - Golden files are named correspondingly ${root}/**/*.golden
Golden files may be missing in some cases, and will be created by the UpdateGoldenIfRequested() method on TestCase.
func (*TestCase) LoadGolden ¶
LoadGolden loads the golden file for a test case.
Failures to load golden file contents reported as non-fatal errors so that the golden file can be updated later.
Callers should skip TestCases where golden file can not be loaded.