TestBashExactExitMarkerFormat pins the exact non-zero-exit shape: output, then a single "\n(exit: ...)" marker. The model parses these, and the other tests only Contains("exit"); a dropped "\n" or doubled marker would pass silently. Also proves real output survives alongside the exit (the `false` te
(t *testing.T)
| 31 | // silently. Also proves real output survives alongside the exit (the `false` |
| 32 | // test emits nothing). |
| 33 | func TestBashExactExitMarkerFormat(t *testing.T) { |
| 34 | out := Bash(context.Background(), "echo out; exit 3", 5*time.Second) |
| 35 | want := "out\n\n(exit: exit status 3)" |
| 36 | if out != want { |
| 37 | t.Fatalf("exit marker format wrong:\n got %q\nwant %q", out, want) |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | func TestBashEmptyCommand(t *testing.T) { |
| 42 | if Bash(context.Background(), " ", time.Second) != "(empty command)" { |