seems like it worked, converting other tests

This commit is contained in:
David Dworken 2022-04-11 23:30:24 -07:00
parent ea51601985
commit 9f1b258a7f

View File

@ -36,12 +36,12 @@ func TestParseTimeGenerously(t *testing.T) {
}
ts, err = parseTimeGenerously("2006-01-02T15:04")
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())
}
ts, err = parseTimeGenerously("2006-01-02")
shared.Check(t, err)
if ts.Unix() != 1136188800 {
if ts.Year() != 2006 || ts.Month() != time.January || ts.Day() != 2 || ts.Hour() != 0 || ts.Minute() != 0 || ts.Second() != 0 {
t.Fatalf("parsed time incorrectly: %d", ts.Unix())
}
}