From 2039ed37bf6b0c7c65ed2836a3b4a6b81aa47d08 Mon Sep 17 00:00:00 2001 From: Ayooluwa Isaiah Date: Sun, 2 May 2021 00:36:03 +0100 Subject: [PATCH] Fix intermittent test failures --- src/variables_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/variables_test.go b/src/variables_test.go index 8fc8d48..28051ca 100644 --- a/src/variables_test.go +++ b/src/variables_test.go @@ -95,7 +95,6 @@ func TestReplaceFilenameVariables(t *testing.T) { func TestReplaceDateVariables(t *testing.T) { testDir := setupFileSystem(t) - // TODO: Fix intermittent failures for _, file := range fileSystem { path := filepath.Join(testDir, file) @@ -118,7 +117,7 @@ func TestReplaceDateVariables(t *testing.T) { accessTime := timeInfo.AccessTime() modTime := timeInfo.ModTime() - fileTimes := []string{"mtime", "atime", "ctime", "now", "btime"} + fileTimes := []string{"mtime", "atime", "ctime", "btime"} for _, v := range fileTimes { var timeValue time.Time @@ -137,8 +136,6 @@ func TestReplaceDateVariables(t *testing.T) { if timeInfo.HasBirthTime() { timeValue = timeInfo.BirthTime() } - case "now": - timeValue = time.Now() } for key, token := range dateTokens { @@ -157,7 +154,11 @@ func TestReplaceDateVariables(t *testing.T) { } if !cmp.Equal(want, got) { - t.Fatalf("Expected %v, but got %v\n", want, got) + t.Fatalf( + "Expected %v, but got %v\n", + prettyPrint(want), + prettyPrint(got), + ) } } }