MCPcopy Index your code
hub / github.com/expr-lang/expr / TestOptimize_sum_range

Function TestOptimize_sum_range

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

Source from the content-addressed store, hash-verified

12)
13
14func TestOptimize_sum_range(t *testing.T) {
15 tree, err := parser.Parse(`sum(1..100)`)
16 require.NoError(t, err)
17
18 err = optimizer.Optimize(&tree.Node, nil)
19 require.NoError(t, err)
20
21 expected := &ast.IntegerNode{Value: 5050}
22
23 assert.Equal(t, ast.Dump(expected), ast.Dump(tree.Node))
24}
25
26func TestOptimize_sum_range_different_values(t *testing.T) {
27 tests := []struct {

Callers

nothing calls this directly

Calls 5

ParseFunction · 0.92
NoErrorFunction · 0.92
OptimizeFunction · 0.92
EqualFunction · 0.92
DumpFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…