unix: use default directories in TestGetwd on darwin/arm64

Go 1.16 renamed the iOS port from darwin/arm64 to ios/arm64 and
darwin/arm64 was repurposed for the macOS ARM64 port (see
https://golang.org/doc/go1.16#darwin).

Now that Go 1.16 is the oldest supported release, the ios tag can be
used exclusively to detect iOS and TestGetwd can use the same list of
directories as other systems.

For golang/go#45696

Change-Id: Ic334df5ea88ac034a9d9271f6cd570617f208f05
Reviewed-on: https://go-review.googlesource.com/c/sys/+/358254
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Tobias Klauser 2021-10-25 07:47:07 +02:00 коммит произвёл Tobias Klauser
Родитель 711f33c999
Коммит 69cdffdb93
1 изменённых файлов: 9 добавлений и 12 удалений

Просмотреть файл

@ -610,19 +610,16 @@ func TestGetwd(t *testing.T) {
switch runtime.GOOS {
case "android":
dirs = []string{"/", "/system/bin"}
case "darwin", "ios":
switch runtime.GOARCH {
case "arm64":
d1, err := ioutil.TempDir("", "d1")
if err != nil {
t.Fatalf("TempDir: %v", err)
}
d2, err := ioutil.TempDir("", "d2")
if err != nil {
t.Fatalf("TempDir: %v", err)
}
dirs = []string{d1, d2}
case "ios":
d1, err := ioutil.TempDir("", "d1")
if err != nil {
t.Fatalf("TempDir: %v", err)
}
d2, err := ioutil.TempDir("", "d2")
if err != nil {
t.Fatalf("TempDir: %v", err)
}
dirs = []string{d1, d2}
}
oldwd := os.Getenv("PWD")
for _, d := range dirs {