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

Function TestCheck_AsBool

checker/checker_test.go:759–769  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

757}
758
759func TestCheck_AsBool(t *testing.T) {
760 tree, err := parser.Parse(`1+2`)
761 require.NoError(t, err)
762
763 config := &conf.Config{}
764 expr.AsBool()(config)
765
766 _, err = checker.Check(tree, config)
767 assert.Error(t, err)
768 assert.Equal(t, "expected bool, but got int", err.Error())
769}
770
771func TestCheck_AsInt64(t *testing.T) {
772 tree, err := parser.Parse(`true`)

Callers

nothing calls this directly

Calls 7

ParseFunction · 0.92
NoErrorFunction · 0.92
AsBoolFunction · 0.92
CheckFunction · 0.92
ErrorFunction · 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…