Skip to content

Commit f22d0c8

Browse files
committed
test: fix filepath tests on windows
1 parent 5a7db3d commit f22d0c8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

main_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"path/filepath"
45
"regexp"
56
"testing"
67

@@ -23,14 +24,18 @@ func TestFindMatchingFiles(t *testing.T) {
2324
matchingFiles, err := findMatchingFiles(appFS, "/src", "public::", nil)
2425

2526
require.Nil(t, err)
26-
require.Equal(t, []string{"/src/.git/a", "/src/a/b", "/src/logseq/a"}, matchingFiles)
27+
require.Equal(t, []string{
28+
filepath.Join("/src", ".git", "a"),
29+
filepath.Join("/src", "a", "b"),
30+
filepath.Join("/src", "logseq", "a"),
31+
}, matchingFiles)
2732
})
2833

2934
t.Run("it ignores files based on the ignoreRegex", func(t *testing.T) {
3035
matchingFiles, err := findMatchingFiles(appFS, "/src", "public::", regexp.MustCompile(`^(logseq|.git)/`))
3136

3237
require.Nil(t, err)
33-
require.Equal(t, []string{"/src/a/b"}, matchingFiles)
38+
require.Equal(t, []string{filepath.Join("/src", "a", "b")}, matchingFiles)
3439
})
3540
}
3641

0 commit comments

Comments
 (0)