mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 03:47:54 +02:00
another attempt at fixing the timestamp tests to run with UTC
This commit is contained in:
parent
fb52b98379
commit
ea51601985
@ -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")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user