Skip to content

Commit

Permalink
fix: fix test case
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <[email protected]>
  • Loading branch information
zong-zhe committed Mar 15, 2024
1 parent db421f4 commit 9a291e7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions pkg/path/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ func TestSanitizePath(t *testing.T) {
input: "test\x00file",
expected: "test_file",
},
{
name: "Path without invalid characters",
input: "/usr/local/bin/test",
expected: "/usr/local/bin/test",
},
}

if runtime.GOOS == "windows" {
Expand All @@ -32,6 +27,17 @@ func TestSanitizePath(t *testing.T) {
name: "Windows style path",
input: "C:\\Program Files\\Test<:>*|",
expected: "C:\\Program Files\\Test_____",
},
)
} else {
tests = append(tests, struct {
name string
input string
expected string
}{
name: "Path without invalid characters",
input: "/usr/local/bin/test",
expected: "/usr/local/bin/test",
})
}

Expand Down

0 comments on commit 9a291e7

Please sign in to comment.