MCPcopy Create free account
hub / github.com/expr-lang/expr / TestOptimize_reduce_range_reversed_errors

Function TestOptimize_reduce_range_reversed_errors

optimizer/sum_range_test.go:240–247  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

238}
239
240func TestOptimize_reduce_range_reversed_errors(t *testing.T) {
241 // reduce on empty range (reversed) should error at runtime
242 program, err := expr.Compile(`reduce(10..1, # + #acc)`)
243 require.NoError(t, err)
244
245 _, err = expr.Run(program, nil)
246 require.Error(t, err, "reduce on empty range should error")
247}
248
249func BenchmarkSumRange_Optimized(b *testing.B) {
250 program, err := expr.Compile(`sum(1..100)`)

Callers

nothing calls this directly

Calls 4

CompileFunction · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
ErrorFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…