diff options
| author | George Adams <georgeadams1995@gmail.com> | 2024-11-19 10:05:27 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-11-19 17:26:40 +0000 |
| commit | 5deea4c2425fd8aa6dee642c63a1bc43e090d04b (patch) | |
| tree | 081b394780d619b01d8b02aeea61833ed84530fc /src/os/path_windows_test.go | |
| parent | 405a0c4ae86fe2761118ee6d1d59e59daf9b50cd (diff) | |
| download | go-5deea4c2425fd8aa6dee642c63a1bc43e090d04b.tar.xz | |
Revert "os: check for valid Windows path when creating files"
This reverts commit CL 618496.
Reason for revert: https://github.com/golang/go/issues/54040#issuecomment-2485151973
Change-Id: I3bf27f7fdd475a005cb6aa190994153504e96fb5
Reviewed-on: https://go-review.googlesource.com/c/go/+/629595
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
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) - } - } -} |
