(t *testing.T)
| 2319 | } |
| 2320 | |
| 2321 | func TestIssue401(t *testing.T) { |
| 2322 | program, err := expr.Compile("(a - b + c) / d", expr.AllowUndefinedVariables()) |
| 2323 | require.NoError(t, err, "compile error") |
| 2324 | |
| 2325 | output, err := expr.Run(program, map[string]any{ |
| 2326 | "a": 1, |
| 2327 | "b": 2, |
| 2328 | "c": 3, |
| 2329 | "d": 4, |
| 2330 | }) |
| 2331 | require.NoError(t, err, "run error") |
| 2332 | require.Equal(t, 0.5, output) |
| 2333 | } |
| 2334 | |
| 2335 | func TestEval_slices_out_of_bound(t *testing.T) { |
| 2336 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…