MCPcopy
hub / github.com/expr-lang/expr / Error

Function Error

internal/testify/assert/assertions.go:1561–1570  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

1559// assert.Equal(t, expectedError, err)
1560// }
1561func Error(t TestingT, err error, msgAndArgs ...interface{}) bool {
1562 if err == nil {
1563 if h, ok := t.(tHelper); ok {
1564 h.Helper()
1565 }
1566 return Fail(t, "An error is expected but got nil.", msgAndArgs...)
1567 }
1568
1569 return true
1570}
1571
1572// EqualError asserts that a function returned an error (i.e. not `nil`)
1573// and that it is equal to the provided error.

Callers 15

TestExpr_eval_with_envFunction · 0.92
TestExpr_fetch_from_funcFunction · 0.92
TestExpr_timeoutFunction · 0.92
TestCheck_AsBoolFunction · 0.92
TestCheck_AsInt64Function · 0.92
TestCheck_PointerNodeFunction · 0.92
TestInterfaceHideFunction · 0.92
ErrorFunction · 0.92
TestBuiltin_errorsFunction · 0.92
ErrorfFunction · 0.70
TestErrorFunction · 0.70

Calls 2

FailFunction · 0.70
HelperMethod · 0.45

Tested by 10

TestExpr_eval_with_envFunction · 0.74
TestExpr_fetch_from_funcFunction · 0.74
TestExpr_timeoutFunction · 0.74
TestCheck_AsBoolFunction · 0.74
TestCheck_AsInt64Function · 0.74
TestCheck_PointerNodeFunction · 0.74
TestInterfaceHideFunction · 0.74
TestBuiltin_errorsFunction · 0.74
TestErrorFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…