mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-26 18:23:27 +01:00
seems like it worked, converting other tests
This commit is contained in:
parent
ea51601985
commit
9f1b258a7f
@ -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())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user