turn: keep the body written before a trailing outcome
ParseOutput returned only the text after the outcome value, so a stage that wrote its result first and "# outcome" last handed the next stage "(no output)" — the probe's Compose and Critique turns were both lost this way. The body is now the whole document with just the outcome heading and value line removed, in order, byte for byte. Tests cover a trailing and a mid-document outcome.
This commit is contained in:
@@ -40,7 +40,7 @@ func TestLayoutRenderAndParseRoundTrip(t *testing.T) {
|
||||
t.Fatalf("memory.md = %q, %v", got, err)
|
||||
}
|
||||
outcome, body, err := ParseOutput(output, []string{"success", "approved", "error"})
|
||||
if err != nil || outcome != "approved" || body != "\n# Findings\n\nnone\n" {
|
||||
if err != nil || outcome != "approved" || body != "# Notes\n\nChecked the diff.\n\n\n# Findings\n\nnone\n" {
|
||||
t.Fatalf("ParseOutput() = %q, %q, %v", outcome, body, err)
|
||||
}
|
||||
missing, _, err := ParseOutput("# Notes\n\nno heading\n", []string{"success"})
|
||||
|
||||
Reference in New Issue
Block a user