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

Function TestVariadicLogicalOperators

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

Source from the content-addressed store, hash-verified

1559}
1560
1561func TestVariadicLogicalOperators(t *testing.T) {
1562 env := testEnv(t, variadicLogicalOperatorASTs())
1563 ast, iss := env.Compile(
1564 `(false || false || false || false || true) &&
1565 (true && true && true && true && false)`)
1566 if iss.Err() != nil {
1567 t.Fatalf("Compile() failed: %v", iss.Err())
1568 }
1569 prg, err := env.Program(ast)
1570 if err != nil {
1571 t.Fatalf("Program(ast) failed: %v", err)
1572 }
1573 out, _, err := prg.Eval(NoVars())
1574 if err != nil {
1575 t.Errorf("Eval() got error %v, wanted false", err)
1576 }
1577 if out != types.False {
1578 t.Errorf("Eval() got %v, wanted false", out)
1579 }
1580}
1581
1582func TestParseError(t *testing.T) {
1583 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