mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Fix failing UnixTime tests
This commit is contained in:
parent
e1ad1f3065
commit
59429b097d
@ -81,18 +81,18 @@ func Test_UnixTime(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "with 0 time",
|
name: "with 0 time",
|
||||||
unixVal: 0,
|
unixVal: 0,
|
||||||
expected: "1969-12-31 16:00:00 -0800 PST",
|
expected: "1970-01-01 00:00:00 +0000 UTC",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "with explicit time",
|
name: "with explicit time",
|
||||||
unixVal: 1564883266,
|
unixVal: 1564883266,
|
||||||
expected: "2019-08-03 18:47:46 -0700 PDT",
|
expected: "2019-08-04 01:47:46 +0000 UTC",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
actual := UnixTime(tt.unixVal)
|
actual := UnixTime(tt.unixVal).UTC()
|
||||||
|
|
||||||
if tt.expected != actual.String() {
|
if tt.expected != actual.String() {
|
||||||
t.Errorf("\nexpected: %s\n got: %s", tt.expected, actual)
|
t.Errorf("\nexpected: %s\n got: %s", tt.expected, actual)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user