test(#146): add TestMainSubprocess_InvalidDocMapPath and TestMainSubprocess_InvalidDocMapFile #151

Merged
rodin merged 1 commits from issue-146 into main 2026-05-15 12:07:28 +00:00
+4
View File
1
@@ -1521,6 +1521,8 @@ func TestMainSubprocess_InvalidDocMapPath(t *testing.T) {
}
cmd := exec.Command(os.Args[0], "-test.run=TestMainSubprocess_InvalidDocMapPath")
// t.TempDir() is evaluated here in the outer process, producing a real directory
// that is passed as the GITHUB_WORKSPACE env var string to the subprocess.
cmd.Env = append(cleanEnv(),
"TEST_SUBPROCESS_MAIN=1",
"GITHUB_WORKSPACE="+t.TempDir(),
Outdated
Review

[NIT] The comment // t.TempDir() is evaluated here in the outer process, producing a real directory / that is passed as the GITHUB_WORKSPACE env var string to the subprocess. is duplicated verbatim in both new test functions. It's accurate and useful, but could be a shared helper (e.g. workspaceEnv(t)) to avoid repeating the same comment+pattern four times total (two existing tests already use similar patterns). Minor — not worth blocking.

**[NIT]** The comment `// t.TempDir() is evaluated here in the outer process, producing a real directory / that is passed as the GITHUB_WORKSPACE env var string to the subprocess.` is duplicated verbatim in both new test functions. It's accurate and useful, but could be a shared helper (e.g. `workspaceEnv(t)`) to avoid repeating the same comment+pattern four times total (two existing tests already use similar patterns). Minor — not worth blocking.
1
@@ -1558,6 +1560,8 @@ func TestMainSubprocess_InvalidDocMapFile(t *testing.T) {
}
cmd := exec.Command(os.Args[0], "-test.run=TestMainSubprocess_InvalidDocMapFile")
// t.TempDir() is evaluated here in the outer process, producing a real directory
// that is passed as the GITHUB_WORKSPACE env var string to the subprocess.
cmd.Env = append(cleanEnv(),
"TEST_SUBPROCESS_MAIN=1",
"GITHUB_WORKSPACE="+t.TempDir(),