Skip to content

Commit

Permalink
Fix intermittent test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoisaiah committed May 1, 2021
1 parent 10d2311 commit 2039ed3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/variables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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 {
Expand All @@ -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),
)
}
}
}
Expand Down

0 comments on commit 2039ed3

Please sign in to comment.