another attempt at fixing the timestamp tests to run with UTC

This commit is contained in:
David Dworken 2022-04-11 23:27:47 -07:00
parent fb52b98379
commit ea51601985

View File

@ -2,6 +2,7 @@ package data
import ( import (
"testing" "testing"
"time"
"github.com/ddworken/hishtory/shared" "github.com/ddworken/hishtory/shared"
) )
@ -30,7 +31,7 @@ func TestParseTimeGenerously(t *testing.T) {
} }
ts, err = parseTimeGenerously("2006-01-02T15:04:00") ts, err = parseTimeGenerously("2006-01-02T15:04:00")
shared.Check(t, err) shared.Check(t, err)
if ts.Unix() != 1136243040 { if ts.Year() != 2006 || ts.Month() != time.January || ts.Day() != 2 || ts.Hour() != 15 || ts.Minute() != 4 || ts.Second() != 0 {
t.Fatalf("parsed time incorrectly: %d", ts.Unix()) t.Fatalf("parsed time incorrectly: %d", ts.Unix())
} }
ts, err = parseTimeGenerously("2006-01-02T15:04") ts, err = parseTimeGenerously("2006-01-02T15:04")