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

Function TestFunctions

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

Source from the content-addressed store, hash-verified

446}
447
448func TestFunctions(t *testing.T) {
449 e, err := NewEnv(OptionalTypes())
450 if err != nil {
451 t.Fatalf("NewEnv() failed: %v", err)
452 }
453 for _, expected := range []string{"optional.of", "or"} {
454 if !e.HasFunction(expected) {
455 t.Errorf("Expected HasFunction() to return true for '%s'", expected)
456 }
457
458 if _, ok := e.Functions()[expected]; !ok {
459 t.Errorf("Expected Functions() to include '%s'", expected)
460 }
461 }
462}
463
464func TestEnvToConfig(t *testing.T) {
465 tests := []struct {

Callers

nothing calls this directly

Calls 4

HasFunctionMethod · 0.95
FunctionsMethod · 0.95
OptionalTypesFunction · 0.85
NewEnvFunction · 0.70

Tested by

no test coverage detected