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

Function init

conformance/conformance_test.go:77–108  ·  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.Math(),
92 ext.Protos(),
93 ext.Strings(),
94 ext.TwoVarComprehensions(),
95 cel.Lib(celBlockLib{}),
96 cel.EnableIdentifierEscapeSyntax(),
97 }
98
99 var err error
100 envNoMacros, err = cel.NewCustomEnv(stdOpts...)
101 if err != nil {
102 log.Fatalf("cel.NewCustomEnv() = %v", err)
103 }
104 envWithMacros, err = envNoMacros.Extend(cel.Macros(cel.StandardMacros...))
105 if err != nil {
106 log.Fatalf("cel.NewCustomEnv() = %v", err)
107 }
108}
109
110func TestMain(m *testing.M) {
111 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
MathFunction · 0.92
ProtosFunction · 0.92
StringsFunction · 0.92
TwoVarComprehensionsFunction · 0.92

Tested by

no test coverage detected