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

Function init

conformance/conformance_test.go:77–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75)
76
77func init() {
78 flag.BoolVar(&dashboard, "dashboard", false, "Dashboard.")
79 flag.Var(&tests, "tests", "Paths to run, separate by a comma.")
80 flag.Var(&skipTests, "skip_tests", "Tests to skip, separate by a comma.")
81
82 stdOpts := []cel.EnvOption{
83 cel.StdLib(),
84 cel.ClearMacros(),
85 cel.OptionalTypes(),
86 cel.EagerlyValidateDeclarations(true),
87 cel.EnableErrorOnBadPresenceTest(true),
88 cel.Types(&test2pb.TestAllTypes{}, &test2pb.Proto2ExtensionScopedMessage{}, &test3pb.TestAllTypes{}),
89 ext.Bindings(),
90 ext.Encoders(),
91 ext.Lists(),
92 ext.Math(),
93 ext.Protos(),
94 ext.Strings(),
95 ext.TwoVarComprehensions(),
96 cel.Lib(celBlockLib{}),
97 cel.EnableIdentifierEscapeSyntax(),
98 }
99
100 var err error
101 envNoMacros, err = cel.NewCustomEnv(stdOpts...)
102 if err != nil {
103 log.Fatalf("cel.NewCustomEnv() = %v", err)
104 }
105 envWithMacros, err = envNoMacros.Extend(cel.Macros(cel.StandardMacros...))
106 if err != nil {
107 log.Fatalf("cel.NewCustomEnv() = %v", err)
108 }
109}
110
111func TestMain(m *testing.M) {
112 flag.Parse()

Callers

nothing calls this directly

Calls 15

StdLibFunction · 0.92
ClearMacrosFunction · 0.92
OptionalTypesFunction · 0.92
TypesFunction · 0.92
BindingsFunction · 0.92
EncodersFunction · 0.92
ListsFunction · 0.92
MathFunction · 0.92
ProtosFunction · 0.92
StringsFunction · 0.92

Tested by

no test coverage detected