diff options
author | Dmitri Shuralyov <dmitshur@google.com> | 2022-06-01 17:42:39 +0000 |
---|---|---|
committer | Dmitri Shuralyov <dmitshur@google.com> | 2022-06-01 17:42:39 +0000 |
commit | 4658e6e324a85b0076f66acdab77799ffa9ac7bb (patch) | |
tree | f3b4de12074d583057060fdf35d91b6591859644 /src/path/filepath/path_windows_test.go | |
parent | 6b07de790c08967d0dbe3a36ec86f3d13e1cfcbd (diff) | |
parent | 26cdea3acca29db94541236f0037a20aa22ce2d7 (diff) | |
download | go-4658e6e324a85b0076f66acdab77799ffa9ac7bb.tar.gz go-4658e6e324a85b0076f66acdab77799ffa9ac7bb.zip |
[dev.boringcrypto.go1.17] all: merge go1.17.11 into dev.boringcrypto.go1.17
Change-Id: I563433b2d02a5abea610a1561139d0980d5c2102
Diffstat (limited to 'src/path/filepath/path_windows_test.go')
-rw-r--r-- | src/path/filepath/path_windows_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go index 76a459ac96..3edafb5a85 100644 --- a/src/path/filepath/path_windows_test.go +++ b/src/path/filepath/path_windows_test.go @@ -530,3 +530,29 @@ func TestNTNamespaceSymlink(t *testing.T) { t.Errorf(`EvalSymlinks(%q): got %q, want %q`, filelink, got, want) } } + +func TestIssue52476(t *testing.T) { + tests := []struct { + lhs, rhs string + want string + }{ + {`..\.`, `C:`, `..\C:`}, + {`..`, `C:`, `..\C:`}, + {`.`, `:`, `:`}, + {`.`, `C:`, `.\C:`}, + {`.`, `C:/a/b/../c`, `.\C:\a\c`}, + {`.`, `\C:`, `.\C:`}, + {`C:\`, `.`, `C:\`}, + {`C:\`, `C:\`, `C:\C:`}, + {`C`, `:`, `C\:`}, + {`\.`, `C:`, `\C:`}, + {`\`, `C:`, `\C:`}, + } + + for _, test := range tests { + got := filepath.Join(test.lhs, test.rhs) + if got != test.want { + t.Errorf(`Join(%q, %q): got %q, want %q`, test.lhs, test.rhs, got, test.want) + } + } +} |