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

Function newTestParser

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

Source from the content-addressed store, hash-verified

2410}
2411
2412func newTestParser(t *testing.T, options ...Option) *Parser {
2413 t.Helper()
2414 defaultOpts := []Option{
2415 Macros(AllMacros...),
2416 MaxRecursionDepth(32),
2417 ErrorRecoveryLimit(4),
2418 ErrorRecoveryLookaheadTokenLimit(4),
2419 PopulateMacroCalls(true),
2420 }
2421 opts := append([]Option{}, defaultOpts...)
2422 opts = append(opts, options...)
2423 p, err := NewParser(opts...)
2424 if err != nil {
2425 t.Fatalf("NewParser() failed: %v", err)
2426 }
2427 return p
2428}
2429
2430// RelativeSource represents an embedded source element within a larger source.
2431type 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