Produce the requested section count when feasible

This commit is contained in:
2026-11-16 04:02:22 +00:00
parent 27f494d4e4
commit 43ce620122
6 changed files with 188 additions and 104 deletions

View File

@@ -1192,6 +1192,20 @@ func TestSubprocessTranscriptPreflightWithoutReporting(t *testing.T) {
}
}
func TestSubprocessInfeasibleSectionTargetIsAnInputFailure(t *testing.T) {
f := newProcessFixture(t, "normal", "[grammar]")
code, stdout, stderr := f.run(t, true, "--target-sections", "10")
if code != 2 || stdout != "" || f.provider.callCount() != 0 || !strings.Contains(stderr, "target_sections") {
t.Fatalf("infeasible target: code=%d stdout=%q stderr=%q calls=%d", code, stdout, stderr, f.provider.callCount())
}
if _, err := os.Stat(f.output); !os.IsNotExist(err) {
t.Fatalf("unexpected transcript output: %v", err)
}
if document := f.errors(t); document.Status != reporting.StatusFailed {
t.Fatalf("report status: %+v", document)
}
}
func TestSubprocessOutputPermissionsHonorUmask(t *testing.T) {
for _, mask := range []string{"0077", "0022"} {
t.Run(mask, func(t *testing.T) {