(t *testing.T)
| 104 | } |
| 105 | |
| 106 | func TestTime_duration(t *testing.T) { |
| 107 | env := map[string]any{ |
| 108 | "foo": time.Date(2000, time.Month(1), 1, 0, 0, 0, 0, time.UTC), |
| 109 | } |
| 110 | program, err := expr.Compile(`now() - duration("1h") < now() && foo + duration("24h") < now()`, expr.Env(env)) |
| 111 | require.NoError(t, err) |
| 112 | |
| 113 | output, err := expr.Run(program, env) |
| 114 | require.NoError(t, err) |
| 115 | require.Equal(t, true, output) |
| 116 | } |
| 117 | |
| 118 | func TestTime_date(t *testing.T) { |
| 119 | var tests = []struct { |