Documentation
¶
Overview ¶
Yet another pithy testing framework `actually`
Index ¶
- func Actual(g any) *testingA
- func Diff(a any, b any) string
- func Dump(a ...any) string
- func Expect(e any) *testingA
- func Expectf(format string, e ...any) *testingA
- func Fail(t *testing.T, reason string, got any, expect ...any)
- func FailNow(fn func())
- func Fatal(t *testing.T, reason string, got any, expect ...any)
- func Got(g any) *testingA
- func GotError(g error) *testingA
- func Skip(t *testing.T, skipReasons ...any)
- func Want(e any) *testingA
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Diff ¶ added in v0.12.0
Diff is a helper function to get a diff string of 2 objects for debugging
func Dump ¶ added in v0.23.0
Dump is a helper function to get a dumped string of objects for debugging
func Expect ¶
func Expect(e any) *testingA
Expect sets the value you expect to be the same as the one you got. Expect creates *testingA and returns it.
func Expectf ¶ added in v0.26.0
Expectf sets the formatted string value you expect to be the same as the one you got. Expectf creates *testingA and returns it.
func Fail ¶ added in v0.21.0
Fail is to show decorated fail report. (Actual shortcut to witness.Fail)
if g != e {
actually.Fail(t, "Not same", g, e)
}
func FailNow ¶ added in v0.21.0
func FailNow(fn func())
The function `FailNow` receives a func that is including tests of `actually`. The included tests inside `FailNow` will stop execution immediately upon failure, even without explicitly calling `FailNow` individually.
actually.FailNow(func() {
actually.Got(false).True(t) // stop this failuer
actually.Got(true).True(t) // not executed
})
func Fatal ¶ added in v0.21.0
Fatal is to show decorated fail report by t.Fatal. (Actual shortcut to witness.FailNow)
if g != e {
actually.FailNow(t, "Not same", g, e)
}
func Got ¶
func Got(g any) *testingA
Got sets the value you actually got. Got() creates *testingA and returns it.
func GotError ¶ added in v0.13.0
func GotError(g error) *testingA
GotError sets the error value you actually got. GotError creates `*testingA` and returns it.
Types ¶
This section is empty.