Skip to content

Commit

Permalink
fix: time issue in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
radulucut committed Sep 3, 2024
1 parent 9ece8a6 commit 9ab09d0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cmd/cleed/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

0 comments on commit 9ab09d0

Please sign in to comment.