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

Function BenchmarkNewStdEnv

checker/env_test.go:67–78  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

65}
66
67func BenchmarkNewStdEnv(b *testing.B) {
68 for i := 0; i < b.N; i++ {
69 env, err := NewEnv(containers.DefaultContainer, newTestRegistry(b))
70 if err != nil {
71 b.Fatalf("NewEnv() failed: %v", err)
72 }
73 err = env.AddFunctions(stdlib.Functions()...)
74 if err != nil {
75 b.Fatalf("env.AddFunctions(stdlib.Functions()...) failed: %v", err)
76 }
77 }
78}
79
80func newStdEnv(t *testing.T) *Env {
81 t.Helper()

Callers

nothing calls this directly

Calls 4

AddFunctionsMethod · 0.95
FunctionsFunction · 0.92
NewEnvFunction · 0.70
newTestRegistryFunction · 0.70

Tested by

no test coverage detected