MCPcopy Create free account
hub / github.com/cel-expr/cel-go / TestVariadicLogicalOperators

Function TestVariadicLogicalOperators

cel/cel_test.go:1665–1684  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1663}
1664
1665func TestVariadicLogicalOperators(t *testing.T) {
1666 env := testEnv(t, variadicLogicalOperatorASTs())
1667 ast, iss := env.Compile(
1668 `(false || false || false || false || true) &&
1669 (true && true && true && true && false)`)
1670 if iss.Err() != nil {
1671 t.Fatalf("Compile() failed: %v", iss.Err())
1672 }
1673 prg, err := env.Program(ast)
1674 if err != nil {
1675 t.Fatalf("Program(ast) failed: %v", err)
1676 }
1677 out, _, err := prg.Eval(NoVars())
1678 if err != nil {
1679 t.Errorf("Eval() got error %v, wanted false", err)
1680 }
1681 if out != types.False {
1682 t.Errorf("Eval() got %v, wanted false", out)
1683 }
1684}
1685
1686func TestParseError(t *testing.T) {
1687 env := testEnv(t)

Callers

nothing calls this directly

Calls 7

NoVarsFunction · 0.85
ErrMethod · 0.80
ProgramMethod · 0.80
testEnvFunction · 0.70
CompileMethod · 0.65
EvalMethod · 0.65

Tested by

no test coverage detected