| 2660 | } |
| 2661 | |
| 2662 | func TestDefaultUTCTimeZoneError(t *testing.T) { |
| 2663 | env := testEnv(t, Variable("x", TimestampType)) |
| 2664 | out, err := interpret(t, env, ` |
| 2665 | x.getFullYear(':xx') == 1969 |
| 2666 | || x.getDayOfYear('xx:') == 364 |
| 2667 | || x.getMonth('Am/Ph') == 11 |
| 2668 | || x.getDayOfMonth('Am/Ph') == 30 |
| 2669 | || x.getDate('Am/Ph') == 31 |
| 2670 | || x.getDayOfWeek('Am/Ph') == 3 |
| 2671 | || x.getHours('Am/Ph') == 19 |
| 2672 | || x.getMinutes('Am/Ph') == 5 |
| 2673 | || x.getSeconds('Am/Ph') == 6 |
| 2674 | || x.getMilliseconds('Am/Ph') == 1 |
| 2675 | `, map[string]any{ |
| 2676 | "x": time.Unix(7506, 1000000).Local(), |
| 2677 | }) |
| 2678 | if err == nil { |
| 2679 | t.Fatalf("prg.Eval() got %v wanted error", out) |
| 2680 | } |
| 2681 | } |
| 2682 | |
| 2683 | func TestParserRecursionLimit(t *testing.T) { |
| 2684 | testCases := []struct { |