Skip to content

Commit

Permalink
normalize filepath separators before comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoisaiah committed Sep 30, 2024
1 parent 4ea580f commit 4144cd3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions internal/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ func CompareSourcePath(t *testing.T, want []string, changes file.Changes) {
got := make([]string, len(changes))

for i := range changes {
got[i] = changes[i].SourcePath
got[i] = filepath.FromSlash(changes[i].SourcePath)
}

for i := range want {
want[i] = filepath.FromSlash(want[i])
}

assert.Equal(t, want, got)
Expand All @@ -120,7 +124,11 @@ func CompareTargetPath(t *testing.T, want []string, changes file.Changes) {
got := make([]string, len(changes))

for i := range changes {
got[i] = changes[i].TargetPath
got[i] = filepath.FromSlash(changes[i].TargetPath)
}

for i := range want {
want[i] = filepath.FromSlash(want[i])
}

assert.Equal(t, want, got)
Expand Down

0 comments on commit 4144cd3

Please sign in to comment.