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

Function TestDeclareContextProto_Duplicate

cel/env_test.go:1334–1344  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1332}
1333
1334func TestDeclareContextProto_Duplicate(t *testing.T) {
1335 desc := (&proto3pb.TestAllTypes{}).ProtoReflect().Descriptor()
1336 env, err := NewEnv(DeclareContextProto(desc))
1337 if err != nil {
1338 t.Fatalf("NewEnv(DeclareContextProto()) failed: %v", err)
1339 }
1340 _, err = DeclareContextProto(desc)(env)
1341 if err == nil {
1342 t.Error("DeclareContextProto() twice should fail")
1343 }
1344}

Callers

nothing calls this directly

Calls 5

DeclareContextProtoFunction · 0.85
NewEnvFunction · 0.70
DescriptorMethod · 0.45
ProtoReflectMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected