Skip to content

Commit

Permalink
Add test for line break in file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rk1274 committed Sep 4, 2024
1 parent 0c51440 commit 0454b61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func TestWalk(t *testing.T) {
So(err, ShouldBeNil)
}

for _, file := range [...]string{"/a/b/c/test.txt", "/a/b/f/test2.csv", "/a/test3"} {
for _, file := range [...]string{"/a/b/c/test.txt", "/a/b/f/tes\nt2.csv", "/a/test3"} {
writeFileString(t, filepath.Join(tmp, file), "")
}

Expand Down Expand Up @@ -555,7 +555,7 @@ func TestWalk(t *testing.T) {

expected := ""
for _, subPath := range []string{"", "/a", "/a/b", "/a/b/c", "/a/b/c/d", "/a/b/c/d/e",
"/a/b/c/test.txt", "/a/b/f", "/a/b/f/test2.csv", "/a/g", "/a/g/h", "/a/test3"} {
"/a/b/c/test.txt", "/a/b/f", "/a/b/f/tes\nt2.csv", "/a/g", "/a/g/h", "/a/test3"} {
expected += encode.Base64Encode(tmp+subPath) + "\n"
}

Expand Down

0 comments on commit 0454b61

Please sign in to comment.