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

Function TestAsBool_exposed_error

expr_test.go:1774–1781  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1772}
1773
1774func TestAsBool_exposed_error(t *testing.T) {
1775 _, err := expr.Compile(`42`, expr.AsBool())
1776 require.Error(t, err)
1777
1778 _, ok := err.(*file.Error)
1779 require.False(t, ok, "error must not be of type *file.Error")
1780 require.Equal(t, "expected bool, but got int", err.Error())
1781}
1782
1783func TestEval_exposed_error(t *testing.T) {
1784 _, err := expr.Eval(`1 % 0`, nil)

Callers

nothing calls this directly

Calls 6

CompileFunction · 0.92
AsBoolFunction · 0.92
ErrorFunction · 0.92
FalseFunction · 0.92
EqualFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…