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

Function newTestParser

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

Source from the content-addressed store, hash-verified

2653}
2654
2655func newTestParser(t *testing.T, options ...Option) *Parser {
2656 t.Helper()
2657 defaultOpts := []Option{
2658 Macros(AllMacros...),
2659 MaxRecursionDepth(32),
2660 ErrorRecoveryLimit(4),
2661 ErrorRecoveryLookaheadTokenLimit(4),
2662 PopulateMacroCalls(true),
2663 }
2664 opts := append([]Option{}, defaultOpts...)
2665 opts = append(opts, options...)
2666 p, err := NewParser(opts...)
2667 if err != nil {
2668 t.Fatalf("NewParser() failed: %v", err)
2669 }
2670 return p
2671}
2672
2673// RelativeSource represents an embedded source element within a larger source.
2674type 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