(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestSanitisePath(t *testing.T) { |
| 9 | cases := []struct { |
| 10 | path string |
| 11 | platform string |
| 12 | want string |
| 13 | }{ |
| 14 | {"/Users/foo/bar", "darin", "/Users/foo/bar"}, |
| 15 | {"/home/foo/bar", "linux", "/home/foo/bar"}, |
| 16 | {"C:\\Users\\foo\\bar", "windows", "/c/Users/foo/bar"}, |
| 17 | } |
| 18 | for _, c := range cases { |
| 19 | gotSanitisedPath := SanitisePath(c.path, c.platform) |
| 20 | if gotSanitisedPath != c.want { |
| 21 | t.Errorf("SanitisedPath %q != %q", gotSanitisedPath, c.want) |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | func TestAddPrefix(t *testing.T) { |
| 27 | cases := []struct { |
nothing calls this directly
no test coverage detected