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

Function TestEnvConcurrentExtend

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

Source from the content-addressed store, hash-verified

221}
222
223func TestEnvConcurrentExtend(t *testing.T) {
224 t.Parallel()
225 baseEnv, err := NewCustomEnv(StdLib())
226 if err != nil {
227 t.Fatalf("NewCustomEnv() failed: %v", err)
228 }
229 var wg sync.WaitGroup
230 for i := 0; i < 50; i++ {
231 wg.Add(1)
232 go func(id int) {
233 defer wg.Done()
234 _, err := baseEnv.Extend(Variable(fmt.Sprintf("v%d", id), StringType))
235 if err != nil {
236 t.Errorf("Extend() failed: %v", err)
237 }
238 }(i)
239 }
240 wg.Wait()
241}
242
243func TestEnvConcurrentExtendAndCompile(t *testing.T) {
244 t.Parallel()

Callers

nothing calls this directly

Calls 5

NewCustomEnvFunction · 0.85
StdLibFunction · 0.85
VariableFunction · 0.70
AddMethod · 0.65
ExtendMethod · 0.45

Tested by

no test coverage detected