MCPcopy Create free account
hub / github.com/JordanCoin/codemap / TestRunHandoffSubcommandLatestVariantsMore

Function TestRunHandoffSubcommandLatestVariantsMore

main_more_test.go:252–282  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

250}
251
252func 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
284func TestRunImportersMode(t *testing.T) {
285 if !scanner.NewAstGrepAnalyzer().Available() {

Callers

nothing calls this directly

Calls 3

WriteLatestFunction · 0.92
captureMainStreamsFunction · 0.85
runHandoffSubcommandFunction · 0.85

Tested by

no test coverage detected