summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2020-09-11 13:09:16 -0600
committerGitHub <noreply@github.com>2020-09-11 13:09:16 -0600
commit1c5969b576ac6e4b147bc5c0dbf2f1b8e76849ef (patch)
tree7800452e11a303bb87e0ab8c05d46a31bad79dc5 /modules
parent0ee4378227cf3019dcbaddeb3977ddd28e58429a (diff)
fileserver: Fix new file hide tests on Windows (#3719)
Diffstat (limited to 'modules')
-rw-r--r--modules/caddyhttp/fileserver/staticfiles_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/caddyhttp/fileserver/staticfiles_test.go b/modules/caddyhttp/fileserver/staticfiles_test.go
index f074318..c47fbd1 100644
--- a/modules/caddyhttp/fileserver/staticfiles_test.go
+++ b/modules/caddyhttp/fileserver/staticfiles_test.go
@@ -161,6 +161,12 @@ func TestFileHidden(t *testing.T) {
expect: false,
},
} {
+ // for Windows' sake
+ tc.inputPath = filepath.FromSlash(tc.inputPath)
+ for i := range tc.inputHide {
+ tc.inputHide[i] = filepath.FromSlash(tc.inputHide[i])
+ }
+
actual := fileHidden(tc.inputPath, tc.inputHide)
if actual != tc.expect {
t.Errorf("Test %d: Is %s hidden in %v? Got %t but expected %t",