os/path_windows_test.go: don't fail on Wine, which allows dots for cur dir even in extended length paths
Этот коммит содержится в:
родитель
e1df2510d4
коммит
929cd767c1
1 изменённых файлов: 11 добавлений и 0 удалений
|
@ -51,6 +51,12 @@ func TestFixLongPath(t *testing.T) {
|
||||||
|
|
||||||
// TODO: bring back upstream version's TestMkdirAllLongPath once os.RemoveAll and t.TempDir implemented
|
// TODO: bring back upstream version's TestMkdirAllLongPath once os.RemoveAll and t.TempDir implemented
|
||||||
|
|
||||||
|
// isWine returns true if executing on wine (Wine Is Not an Emulator), which
|
||||||
|
// is compatible with windows but does not reproduce all its quirks.
|
||||||
|
func isWine() bool {
|
||||||
|
return os.Getenv("WINEUSERNAME") != ""
|
||||||
|
}
|
||||||
|
|
||||||
func TestMkdirAllExtendedLength(t *testing.T) {
|
func TestMkdirAllExtendedLength(t *testing.T) {
|
||||||
// TODO: revert to upstream version once os.RemoveAll and t.TempDir implemented
|
// TODO: revert to upstream version once os.RemoveAll and t.TempDir implemented
|
||||||
tmpDir := os.TempDir()
|
tmpDir := os.TempDir()
|
||||||
|
@ -68,6 +74,11 @@ func TestMkdirAllExtendedLength(t *testing.T) {
|
||||||
t.Fatalf("MkdirAll(%q) failed: %v", path, err)
|
t.Fatalf("MkdirAll(%q) failed: %v", path, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if isWine() {
|
||||||
|
// TODO: use t.Skip once implemented
|
||||||
|
t.Log("wine: Skipping check for no-dots-for-you quirk in windows extended paths")
|
||||||
|
return
|
||||||
|
}
|
||||||
path = path + `.\dir2`
|
path = path + `.\dir2`
|
||||||
if err := os.MkdirAll(path, 0777); err == nil {
|
if err := os.MkdirAll(path, 0777); err == nil {
|
||||||
t.Fatalf("MkdirAll(%q) should have failed, but did not", path)
|
t.Fatalf("MkdirAll(%q) should have failed, but did not", path)
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче