MCPcopy Create free account
hub / github.com/segmentio/encoding / assertErrorPresence

Function assertErrorPresence

json/golang_shim_test.go:54–60  ·  view source on GitHub ↗
(t *testing.T, expected error, actual error, prefixes ...any)

Source from the content-addressed store, hash-verified

52}
53
54func assertErrorPresence(t *testing.T, expected error, actual error, prefixes ...any) {
55 if expected != nil && actual == nil {
56 errorWithPrefixes(t, prefixes, "expected error, but did not get an error")
57 } else if expected == nil && actual != nil {
58 errorWithPrefixes(t, prefixes, "did not expect error but got %v", actual)
59 }
60}
61
62func errorWithPrefixes(t *testing.T, prefixes []any, format string, elements ...any) {
63 fullFormat := format

Callers 3

TestUnmarshalFunction · 0.85
TestIndentErrorsFunction · 0.85

Calls 1

errorWithPrefixesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…