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

Function newTestParser

parser/parser_test.go:2394–2410  ·  view source on GitHub ↗
(t *testing.T, options ...Option)

Source from the content-addressed store, hash-verified

2392}
2393
2394func newTestParser(t *testing.T, options ...Option) *Parser {
2395 t.Helper()
2396 defaultOpts := []Option{
2397 Macros(AllMacros...),
2398 MaxRecursionDepth(32),
2399 ErrorRecoveryLimit(4),
2400 ErrorRecoveryLookaheadTokenLimit(4),
2401 PopulateMacroCalls(true),
2402 }
2403 opts := append([]Option{}, defaultOpts...)
2404 opts = append(opts, options...)
2405 p, err := NewParser(opts...)
2406 if err != nil {
2407 t.Fatalf("NewParser() failed: %v", err)
2408 }
2409 return p
2410}
2411
2412// RelativeSource represents an embedded source element within a larger source.
2413type RelativeSource struct {

Callers 2

TestParseFunction · 0.85
TestParseErrorDataFunction · 0.85

Calls 6

MaxRecursionDepthFunction · 0.85
ErrorRecoveryLimitFunction · 0.85
PopulateMacroCallsFunction · 0.85
MacrosFunction · 0.70
NewParserFunction · 0.70

Tested by

no test coverage detected