setupHome sets the test's HOME to a unique temp directory. The testscript package sets it to /no-home by default (presumably to improve isolation), but this breaks most programs.
(env *testscript.Env)
| 29 | // package sets it to /no-home by default (presumably to improve isolation), but |
| 30 | // this breaks most programs. |
| 31 | func setupHome(env *testscript.Env) { |
| 32 | env.Setenv(envir.Home, env.T().(testing.TB).TempDir()) |
| 33 | } |
| 34 | |
| 35 | // setupPATH removes all directories from the test's PATH to ensure that it only |
| 36 | // uses the PATH set by devbox. The one exception is the testscript's bin |