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

Function TestContextVariableValidate

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

Source from the content-addressed store, hash-verified

553}
554
555func TestContextVariableValidate(t *testing.T) {
556 ctx := NewContextVariable("")
557 err := ctx.Validate()
558 if err == nil || !strings.Contains(err.Error(), "invalid context variable") {
559 t.Errorf("ctx.Validate() got %v, wanted error 'invalid context variable'", err)
560 }
561}
562
563func TestVariableGetType(t *testing.T) {
564 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