@marcel91200 / caddy Mirror · read-only / commits / 1c5969b5
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

fileserver: Fix new file hide tests on Windows (#3719)

Matt Holt committed Sep 11, 2020 at 13:09 UTC 1c5969b576ac6e4b147bc5c0dbf2f1b8e76849ef
1 file changed +6
modules/caddyhttp/fileserver/staticfiles_test.go
+6
@@ -161,6 +161,12 @@ func TestFileHidden(t *testing.T) {
161 expect: false,
162 },
163 } {
164 + // for Windows' sake
165 + tc.inputPath = filepath.FromSlash(tc.inputPath)
166 + for i := range tc.inputHide {
167 + tc.inputHide[i] = filepath.FromSlash(tc.inputHide[i])
168 + }
169 +
170 actual := fileHidden(tc.inputPath, tc.inputHide)
171 if actual != tc.expect {
172 t.Errorf("Test %d: Is %s hidden in %v? Got %t but expected %t",