"src/internal/abi",
"src/internal/bytealg",
"src/internal/cpu",
+ "src/internal/goexperiment",
"src/math/bits",
"src/unsafe",
filepath.Join("pkg", runtime.GOOS+"_"+runtime.GOARCH),
tg.grepStderrNot("no packages being tested depend on matches", "bad match message")
tg.grepStdout("coverage: 100", "no coverage")
}
+
+// Regression test for golang.org/issue/34499: version command should not crash
+// when executed in a deleted directory on Linux.
+func TestExecInDeletedDir(t *testing.T) {
+ switch runtime.GOOS {
+ case "windows", "plan9",
+ "aix", // Fails with "device busy".
+ "solaris", "illumos": // Fails with "invalid argument".
+ t.Skipf("%v does not support removing the current working directory", runtime.GOOS)
+ }
+ tg := testgo(t)
+ defer tg.cleanup()
+
+ wd, err := os.Getwd()
+ tg.check(err)
+ tg.makeTempdir()
+ tg.check(os.Chdir(tg.tempdir))
+ defer func() { tg.check(os.Chdir(wd)) }()
+
+ tg.check(os.Remove(tg.tempdir))
+
+ // `go version` should not fail
+ tg.run("version")
+}