Skip to content

Commit 9a291e7

Browse files
committed
fix: fix test case
Signed-off-by: zongz <zongzhe1024@163.com>
1 parent db421f4 commit 9a291e7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

pkg/path/path_test.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ func TestSanitizePath(t *testing.T) {
1616
input: "test\x00file",
1717
expected: "test_file",
1818
},
19-
{
20-
name: "Path without invalid characters",
21-
input: "/usr/local/bin/test",
22-
expected: "/usr/local/bin/test",
23-
},
2419
}
2520

2621
if runtime.GOOS == "windows" {
@@ -32,6 +27,17 @@ func TestSanitizePath(t *testing.T) {
3227
name: "Windows style path",
3328
input: "C:\\Program Files\\Test<:>*|",
3429
expected: "C:\\Program Files\\Test_____",
30+
},
31+
)
32+
} else {
33+
tests = append(tests, struct {
34+
name string
35+
input string
36+
expected string
37+
}{
38+
name: "Path without invalid characters",
39+
input: "/usr/local/bin/test",
40+
expected: "/usr/local/bin/test",
3541
})
3642
}
3743

0 commit comments

Comments
 (0)