diff options
Diffstat (limited to 'src/os/path_windows_test.go')
| -rw-r--r-- | src/os/path_windows_test.go | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/os/path_windows_test.go b/src/os/path_windows_test.go index e1f0697979..3fa02e2a65 100644 --- a/src/os/path_windows_test.go +++ b/src/os/path_windows_test.go @@ -278,56 +278,3 @@ func BenchmarkAddExtendedPrefix(b *testing.B) { os.AddExtendedPrefix(veryLong) } } - -func TestValidatePathForCreate(t *testing.T) { - tests := []struct { - path string - pass bool - }{ - {`C:\foo`, true}, - {`C:\foo\ `, false}, - {`C:\foo\.`, true}, - {`C:\foo.`, false}, - {`C:\foo\ .`, false}, - {`C:\foo \`, false}, - {"C:/foo/", true}, - {"C:/foo", true}, - {"C:/foo/.", true}, - {"C:/foo/ .", false}, - {".", true}, - {"..", true}, - {"...", false}, - {`\\?\C:\foo`, true}, - {`\\?\C:\foo\ `, true}, - {`\\?\C:\foo\.`, true}, - {`\??\C:\foo`, true}, - {`\??\C:\foo\ `, true}, - {`\??\C:\foo\.`, true}, - {`\\server\share\path`, true}, - {"", true}, - {" ", false}, - {"C:.", true}, - {"C: ", false}, - {"C:..", true}, - {"C:...", false}, - {"foo:.", false}, - {"C:bar:..", false}, - {`\..`, true}, - {`\...`, false}, - {"/.", true}, - {"/..", true}, - {"a..", false}, - {"aa..", false}, - {"a ", false}, - {`a\ `, false}, - {`a \`, false}, - {`.\`, true}, - {`..\`, true}, - } - - for _, tt := range tests { - if os.ValidatePathForCreate(tt.path) != tt.pass { - t.Errorf("validatePathForCreate(%q) = %v, want %v", tt.path, !tt.pass, tt.pass) - } - } -} |
