(t *testing.T)
| 250 | } |
| 251 | |
| 252 | func TestRunHandoffSubcommandLatestVariantsMore(t *testing.T) { |
| 253 | root := t.TempDir() |
| 254 | |
| 255 | stdout, _ := captureMainStreams(t, func() { |
| 256 | runHandoffSubcommand([]string{"--latest", root}) |
| 257 | }) |
| 258 | if !strings.Contains(stdout, "No handoff artifact found") { |
| 259 | t.Fatalf("expected missing handoff message, got:\n%s", stdout) |
| 260 | } |
| 261 | |
| 262 | artifact := &handoff.Artifact{ |
| 263 | SchemaVersion: handoff.SchemaVersion, |
| 264 | GeneratedAt: time.Now(), |
| 265 | Branch: "feature/test", |
| 266 | BaseRef: "main", |
| 267 | Prefix: handoff.PrefixSnapshot{FileCount: 4}, |
| 268 | Delta: handoff.DeltaSnapshot{ |
| 269 | Changed: []handoff.FileStub{{Path: "main.go", Status: "modified"}}, |
| 270 | }, |
| 271 | } |
| 272 | if err := handoff.WriteLatest(root, artifact); err != nil { |
| 273 | t.Fatal(err) |
| 274 | } |
| 275 | |
| 276 | stdout, _ = captureMainStreams(t, func() { |
| 277 | runHandoffSubcommand([]string{"--latest", "--prefix", "--json", root}) |
| 278 | }) |
| 279 | if !strings.Contains(stdout, `"file_count": 4`) { |
| 280 | t.Fatalf("expected prefix JSON output, got:\n%s", stdout) |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | func TestRunImportersMode(t *testing.T) { |
| 285 | if !scanner.NewAstGrepAnalyzer().Available() { |
nothing calls this directly
no test coverage detected