MCPcopy Index your code
hub / github.com/coder/slog / Equal

Function Equal

sloggers/slogtest/assert/assert.go:25–34  ·  view source on GitHub ↗

Equal asserts exp == act. If they are not equal, it will fatal the test with a diff of the two objects. Errors will be compared with errors.Is.

(t testing.TB, name string, exp, act interface{}, opts ...cmp.Option)

Source from the content-addressed store, hash-verified

23//
24// Errors will be compared with errors.Is.
25func Equal(t testing.TB, name string, exp, act interface{}, opts ...cmp.Option) {
26 slog.Helper()
27
28 if diff := assert.Diff(exp, act, opts...); diff != "" {
29 slogtest.Fatal(t, "unexpected value",
30 slog.F("name", name),
31 slog.F("diff", diff),
32 )
33 }
34}
35
36// Success asserts err == nil.
37func Success(t testing.TB, name string, err error) {

Callers 4

TestEqualFunction · 0.92
TestEqual_errorFunction · 0.92
TrueFunction · 0.70
FalseFunction · 0.70

Calls 3

DiffFunction · 0.92
FatalFunction · 0.92
HelperMethod · 0.45

Tested by 2

TestEqualFunction · 0.74
TestEqual_errorFunction · 0.74