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

Function TestErrorsReportingLimit

common/errors_test.go:49–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestErrorsReportingLimit(t *testing.T) {
50 errors := NewErrors(NewTextSource("hello world"))
51 for i := 0; i < 2*errors.maxErrorsToReport; i++ {
52 errors.ReportError(NoLocation, "error %d", i)
53 }
54 if !strings.HasSuffix(errors.ToDisplayString(), "100 more errors were truncated") {
55 t.Errorf("Error truncation did not succeed, got %s, wanted 100 errors truncated", errors.ToDisplayString())
56 }
57}
58
59func TestErrorsAppendReportingLimit(t *testing.T) {
60 errors := NewErrors(NewTextSource("hello world"))

Callers

nothing calls this directly

Calls 4

ReportErrorMethod · 0.95
ToDisplayStringMethod · 0.95
NewErrorsFunction · 0.85
NewTextSourceFunction · 0.85

Tested by

no test coverage detected