@@ -170,6 +170,13 @@ func fakeDownloadServer(requestor, teamSlug string) *httptest.Server {
170170 fmt .Fprint (w , "this is a special file" )
171171 })
172172
173+ mux .HandleFunc ("/\\ with-leading-backslash.txt" , func (w http.ResponseWriter , r * http.Request ) {
174+ fmt .Fprint (w , "with backslash in name" )
175+ })
176+ mux .HandleFunc ("/\\ with\\ backslashes\\ in\\ path.txt" , func (w http.ResponseWriter , r * http.Request ) {
177+ fmt .Fprint (w , "with backslash in path" )
178+ })
179+
173180 mux .HandleFunc ("/with-leading-slash.txt" , func (w http.ResponseWriter , r * http.Request ) {
174181 fmt .Fprint (w , "this has a slash" )
175182 })
@@ -220,6 +227,16 @@ func assertDownloadedCorrectFiles(t *testing.T, targetDir string) {
220227 path : filepath .Join (targetDir , "bogus-track" , "bogus-exercise" , "with-leading-slash.txt" ),
221228 contents : "this has a slash" ,
222229 },
230+ {
231+ desc : "a file with a leading backslash" ,
232+ path : filepath .Join (targetDir , "bogus-track" , "bogus-exercise" , "with-leading-backslash.txt" ),
233+ contents : "with backslash in name" ,
234+ },
235+ {
236+ desc : "a file with backslashes in path" ,
237+ path : filepath .Join (targetDir , "bogus-track" , "bogus-exercise" , "with" , "backslashes" , "in" , "path.txt" ),
238+ contents : "with backslash in path" ,
239+ },
223240 }
224241
225242 for _ , file := range expectedFiles {
@@ -259,6 +276,8 @@ const payloadTemplate = `
259276 "subdir/file-2.txt",
260277 "special-char-filename#.txt",
261278 "/with-leading-slash.txt",
279+ "\\with-leading-backslash.txt",
280+ "\\with\\backslashes\\in\\path.txt",
262281 "file-3.txt"
263282 ],
264283 "iteration": {
0 commit comments