From: Takeshi Yoneda Date: Thu, 27 Apr 2023 04:37:48 +0000 (+0900) Subject: os: fix TestChdirAndGetwd/ReaddirnamesOneAtATime on wasip1 to run on Windows hosts X-Git-Tag: go1.21rc1~750 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=08357012247db5c84002b7a4c1693411a1a9b295;p=gostls13.git os: fix TestChdirAndGetwd/ReaddirnamesOneAtATime on wasip1 to run on Windows hosts TestReaddirnamesOneAtATime and TestChdirAndGetwd assumes the underlying file system has /usr/bin but it is not the case when running it on WASI runtime hosted on Windows. This change adds wasip1 in the special cased switch case to make them host OS agonstic. Change-Id: Idb667021b565f939c814b9cd9e637cd75f9a610d Reviewed-on: https://go-review.googlesource.com/c/go/+/489575 Auto-Submit: Ian Lance Taylor Reviewed-by: Johan Brandhorst-Satzkorn Reviewed-by: Dmitri Shuralyov Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor Run-TryBot: Johan Brandhorst-Satzkorn --- diff --git a/src/os/os_test.go b/src/os/os_test.go index 55651d8ace..a0d9411b6e 100644 --- a/src/os/os_test.go +++ b/src/os/os_test.go @@ -633,7 +633,7 @@ func TestReaddirnamesOneAtATime(t *testing.T) { switch runtime.GOOS { case "android": dir = "/system/bin" - case "ios": + case "ios", "wasip1": wd, err := Getwd() if err != nil { t.Fatal(err) @@ -1490,7 +1490,7 @@ func TestChdirAndGetwd(t *testing.T) { dirs = []string{"/system/bin"} case "plan9": dirs = []string{"/", "/usr"} - case "ios", "windows": + case "ios", "windows", "wasip1": dirs = nil for _, dir := range []string{t.TempDir(), t.TempDir()} { // Expand symlinks so path equality tests work.