| 2680 | } |
| 2681 | |
| 2682 | func TestDefaultUTCTimeZoneError(t *testing.T) { |
| 2683 | env := testEnv(t, Variable("x", TimestampType)) |
| 2684 | out, err := interpret(t, env, ` |
| 2685 | x.getFullYear(':xx') == 1969 |
| 2686 | || x.getDayOfYear('xx:') == 364 |
| 2687 | || x.getMonth('Am/Ph') == 11 |
| 2688 | || x.getDayOfMonth('Am/Ph') == 30 |
| 2689 | || x.getDate('Am/Ph') == 31 |
| 2690 | || x.getDayOfWeek('Am/Ph') == 3 |
| 2691 | || x.getHours('Am/Ph') == 19 |
| 2692 | || x.getMinutes('Am/Ph') == 5 |
| 2693 | || x.getSeconds('Am/Ph') == 6 |
| 2694 | || x.getMilliseconds('Am/Ph') == 1 |
| 2695 | `, map[string]any{ |
| 2696 | "x": time.Unix(7506, 1000000).Local(), |
| 2697 | }) |
| 2698 | if err == nil { |
| 2699 | t.Fatalf("prg.Eval() got %v wanted error", out) |
| 2700 | } |
| 2701 | } |
| 2702 | |
| 2703 | func TestParserRecursionLimit(t *testing.T) { |
| 2704 | testCases := []struct { |