Documentation
¶
Index ¶
- func Contains(t reporter, actual []string, expected ...Substring)
- func Count(t reporter, actual []string, expected LineCount)
- func Empty(t reporter, actual []string)
- func Equal[T comparable](t reporter, actual, expected T, label Label)
- func Error(t reporter, err error)
- func ErrorContains(t reporter, err error, expected Substring)
- func False(t reporter, isCondition Condition, message Message)
- func Format(format Template, args ...any) string
- func Lines(t reporter, actual, expected []string)
- func NoError(t reporter, err error)
- func NotContains(t reporter, actual []string, unexpected ...Substring)
- func Prefix(t reporter, actual []string, prefix LinePrefix)
- func Suffix(t reporter, actual []string, suffix LineSuffix)
- func True(t reporter, isCondition Condition, message Message)
- type Condition
- type Label
- type LineCount
- type LinePrefix
- type LineSuffix
- type Message
- type Substring
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
func Equal[T comparable](t reporter, actual, expected T, label Label)
Equal compares two values and reports if they differ.
func ErrorContains ¶
ErrorContains verifies that an error contains the expected substring.
func Lines ¶
func Lines(t reporter, actual, expected []string)
Lines verifies that actual output matches expected lines. Reports detailed differences using Errorf if they don't match.
func NotContains ¶
NotContains verifies that the actual output does not contain any of the given strings.
func Prefix ¶
func Prefix(t reporter, actual []string, prefix LinePrefix)
Prefix verifies that each line starts with the expected prefix.
func Suffix ¶
func Suffix(t reporter, actual []string, suffix LineSuffix)
Suffix verifies that each line ends with the expected suffix.
Types ¶
type Condition ¶ added in v0.1.0
type Condition bool
Condition is a boolean expectation checked by True and False.
type Label ¶ added in v0.1.0
type Label string
Label names the value under comparison in a failure message.
type LinePrefix ¶ added in v0.1.0
type LinePrefix string
LinePrefix is text every output line must start with.
type LineSuffix ¶ added in v0.1.0
type LineSuffix string
LineSuffix is text every output line must end with.
type Message ¶ added in v0.1.0
type Message string
Message describes an assertion in its failure report.