From 4fad10bade05e5cec38aa1b81096b1dbdae780d9 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Sat, 7 May 2022 11:51:56 -0400 Subject: [PATCH] fix tests --- internal/reddit/types.go | 4 ++-- internal/reddit/types_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/reddit/types.go b/internal/reddit/types.go index 4714f72..1629975 100644 --- a/internal/reddit/types.go +++ b/internal/reddit/types.go @@ -82,7 +82,7 @@ type Thing struct { Title string `json:"title"` URL string `json:"url"` Flair string `json:"flair"` - Thumbnail string `json:"thumbnail"` + Thumbnail string `json:"thumbnail"` } func (t *Thing) FullName() string { @@ -106,7 +106,7 @@ func NewThing(val *fastjson.Value) *Thing { t.Author = string(data.GetStringBytes("author")) t.Subject = string(data.GetStringBytes("subject")) t.Body = string(data.GetStringBytes("body")) - t.CreatedAt = time.Unix(unix, 0) + t.CreatedAt = time.Unix(unix, 0).UTC() t.Context = string(data.GetStringBytes("context")) t.ParentID = string(data.GetStringBytes("parent_id")) t.LinkTitle = string(data.GetStringBytes("link_title")) diff --git a/internal/reddit/types_test.go b/internal/reddit/types_test.go index e7b2ead..f44e76f 100644 --- a/internal/reddit/types_test.go +++ b/internal/reddit/types_test.go @@ -62,7 +62,7 @@ func TestListingResponseParsing(t *testing.T) { assert.Equal(t, "", l.Before) thing := l.Children[0] - created := time.Time(time.Date(2021, time.July, 14, 13, 56, 35, 0, time.Local)) + created := time.Time(time.Date(2021, time.July, 14, 17, 56, 35, 0, time.UTC)) assert.Equal(t, "t4", thing.Kind) assert.Equal(t, "138z6ke", thing.ID) assert.Equal(t, "unknown", thing.Type)