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

Function TestContextVariableValidate

common/env/env_test.go:612–618  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

610}
611
612func TestContextVariableValidate(t *testing.T) {
613 ctx := NewContextVariable("")
614 err := ctx.Validate()
615 if err == nil || !strings.Contains(err.Error(), "invalid context variable") {
616 t.Errorf("ctx.Validate() got %v, wanted error 'invalid context variable'", err)
617 }
618}
619
620func TestVariableGetType(t *testing.T) {
621 tests := []struct {

Callers

nothing calls this directly

Calls 4

ValidateMethod · 0.95
NewContextVariableFunction · 0.85
ContainsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected