Documentation ¶
Overview ¶
Package difftest implement test based on serialized string output
User provides a function that gets a input string. It returns a output string based on the input somehow and a output path to file with content to compare it to or to write to if in write mode. If there is a difference test will fail with a diff.
Test inputs are read from files matching Pattern from Path.
Note that output path can be the same as input which useful if the function implements some kind of transcript that includes both input and output.
Index ¶
- func Error(t tf, expected string, actual string)
- func ErrorEx(t tf, color bool, expected string, actual string)
- func Fatal(t tf, expected string, actual string)
- func FatalEx(t tf, color bool, expected string, actual string)
- func Test(t *testing.T, pattern string, fn Fn)
- func TestWithOptions(t *testing.T, opts Options)
- type Fn
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestWithOptions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.