(t *testing.T)
| 1108 | } |
| 1109 | if !strings.Contains(script, "execution session for flow task with-fresh") { |
| 1110 | t.Errorf("bootstrap prompt should be intact: %s", script) |
| 1111 | } |
| 1112 | if !strings.Contains(script, "[via flow do --with]") { |
| 1113 | t.Errorf("injected text should carry the marker: %s", script) |
| 1114 | } |
| 1115 | if !strings.Contains(script, "check upstream PR") { |
| 1116 | t.Errorf("injected text body missing: %s", script) |
| 1117 | } |
| 1118 | bootstrapIdx := strings.Index(script, "execution session for flow task") |
| 1119 | markerIdx := strings.Index(script, "[via flow do --with]") |
| 1120 | if bootstrapIdx == -1 || markerIdx == -1 || markerIdx < bootstrapIdx { |
| 1121 | t.Errorf("marker must come after bootstrap prompt: %s", script) |
| 1122 | } |
| 1123 | } |
| 1124 | |
| 1125 | func TestCmdDoWithResumeAppendsPositionalArg(t *testing.T) { |
| 1126 | setupFlowRoot(t) |
| 1127 | seedTask(t, "with-resume") |
| 1128 | |
| 1129 | db := openFlowDB(t) |
| 1130 | if _, err := db.Exec(`UPDATE tasks SET session_id='resume-sid', session_started=? WHERE slug='with-resume'`, flowdb.NowISO()); err != nil { |
| 1131 | t.Fatal(err) |
| 1132 | } |
| 1133 | db.Close() |
| 1134 | |
| 1135 | _, getScript := stubITerm(t) |
| 1136 | if rc := cmdDo([]string{"with-resume", "--with", "ping the user"}); rc != 0 { |
| 1137 | t.Fatalf("rc=%d", rc) |
| 1138 | } |
| 1139 | script := getScript() |
| 1140 | if !strings.Contains(script, "claude --resume resume-sid") { |
| 1141 | t.Errorf("resume path should still emit --resume: %s", script) |
| 1142 | } |
| 1143 | if !strings.Contains(script, "[via flow do --with]") { |
| 1144 | t.Errorf("resume path should carry the marker: %s", script) |
| 1145 | } |
| 1146 | if !strings.Contains(script, "ping the user") { |
| 1147 | t.Errorf("resume path missing injected body: %s", script) |
| 1148 | } |
| 1149 | } |
| 1150 |
nothing calls this directly
no test coverage detected