From: Ian Lance Taylor Date: Mon, 31 Oct 2022 20:41:59 +0000 (-0700) Subject: os: in TestDirFS only check returned path for unexpected string X-Git-Tag: go1.20rc1~490 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3848b44c754229125195e2f95bb71868d1a36f56;p=gostls13.git os: in TestDirFS only check returned path for unexpected string The test added in CL 446115 was failing on Plan 9, on which the error returned by a failed open includes the path that failed. Change-Id: If27222596c3cb0366a030bb49ae41c4c869c3db2 Reviewed-on: https://go-review.googlesource.com/c/go/+/446641 Reviewed-by: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Reviewed-by: David du Colombier <0intro@gmail.com> Run-TryBot: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor --- diff --git a/src/os/os_test.go b/src/os/os_test.go index 52fac4f63c..a1b954c438 100644 --- a/src/os/os_test.go +++ b/src/os/os_test.go @@ -2727,7 +2727,7 @@ func TestDirFS(t *testing.T) { if !strings.Contains(err.Error(), nonesuch) { t.Errorf("error %q does not contain %q", err, nonesuch) } - if strings.Contains(err.Error(), "testdata") { + if strings.Contains(err.(*PathError).Path, "testdata") { t.Errorf("error %q contains %q", err, "testdata") } }