From 9ab09d06cdabfa0c8e737fc88d1b18c004a80a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radu=20Lucu=C8=9B?= Date: Tue, 3 Sep 2024 12:11:01 +0300 Subject: [PATCH] fix: time issue in tests --- cmd/cleed/root_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmd/cleed/root_test.go b/cmd/cleed/root_test.go index 49ab1ed..f3068db 100644 --- a/cmd/cleed/root_test.go +++ b/cmd/cleed/root_test.go @@ -1209,8 +1209,13 @@ func Test_Cache_Info(t *testing.T) { err = root.Cmd.Execute() assert.NoError(t, err) - assert.Equal(t, `URL Last fetch Fetch after -https://example.com/atom 2024-01-01 02:00:00 2024-01-01 02:05:00 -https://example.com/rss 2024-01-01 02:00:00 2024-01-01 02:05:00 -`, out.String()) + assert.Equal(t, fmt.Sprintf(`URL Last fetch Fetch after +https://example.com/atom %s %s +https://example.com/rss %s %s +`, + time.Unix(defaultCurrentTime.Unix(), 0).Format("2006-01-02 15:04:05"), + time.Unix(defaultCurrentTime.Unix()+300, 0).Format("2006-01-02 15:04:05"), + time.Unix(defaultCurrentTime.Unix(), 0).Format("2006-01-02 15:04:05"), + time.Unix(defaultCurrentTime.Unix()+300, 0).Format("2006-01-02 15:04:05"), + ), out.String()) }