MCPcopy Index your code
hub / github.com/expr-lang/expr / Error

Method Error

internal/testify/require/require_forward.go:233–238  ·  view source on GitHub ↗

Error asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() if a.Error(err) { assert.Equal(t, expectedError, err) }

(err error, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

231// assert.Equal(t, expectedError, err)
232// }
233func (a *Assertions) Error(err error, msgAndArgs ...interface{}) {
234 if h, ok := a.t.(tHelper); ok {
235 h.Helper()
236 }
237 Error(a.t, err, msgAndArgs...)
238}
239
240// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
241// This is a wrapper for errors.As.

Callers 15

TestImplementsFunction · 0.45
TestIsTypeFunction · 0.45
TestEqualFunction · 0.45
TestNotEqualFunction · 0.45
TestExactlyFunction · 0.45
TestNotNilFunction · 0.45
TestNilFunction · 0.45
TestTrueFunction · 0.45
TestFalseFunction · 0.45
TestContainsFunction · 0.45
TestNotContainsFunction · 0.45
TestPanicsFunction · 0.45

Calls 2

ErrorFunction · 0.70
HelperMethod · 0.45

Tested by 15

TestImplementsFunction · 0.36
TestIsTypeFunction · 0.36
TestEqualFunction · 0.36
TestNotEqualFunction · 0.36
TestExactlyFunction · 0.36
TestNotNilFunction · 0.36
TestNilFunction · 0.36
TestTrueFunction · 0.36
TestFalseFunction · 0.36
TestContainsFunction · 0.36
TestNotContainsFunction · 0.36
TestPanicsFunction · 0.36