MCPcopy Create free account
hub / github.com/driangle/taskmd / TestRunSnapshot_DerivedFlag

Function TestRunSnapshot_DerivedFlag

apps/cli/internal/cli/snapshot_test.go:432–458  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

430}
431
432func TestRunSnapshot_DerivedFlag(t *testing.T) {
433 tmpDir := createSnapshotTestFiles(t)
434 resetSnapshotFlags()
435 snapshotDerived = true
436
437 output, err := captureSnapshotOutput(t, []string{tmpDir})
438 if err != nil {
439 t.Fatalf("runSnapshot failed: %v", err)
440 }
441
442 var result SnapshotOutput
443 if err := json.Unmarshal([]byte(output), &result); err != nil {
444 t.Fatalf("failed to parse JSON: %v", err)
445 }
446
447 // At least one task should have derived fields
448 foundDerived := false
449 for _, snap := range result.Tasks {
450 if snap.IsBlocked != nil || snap.DependencyDepth != nil {
451 foundDerived = true
452 break
453 }
454 }
455 if !foundDerived {
456 t.Error("derived flag set but no derived fields found in output")
457 }
458}
459
460func TestRunSnapshot_GroupBy(t *testing.T) {
461 tmpDir := createSnapshotTestFiles(t)

Callers

nothing calls this directly

Calls 4

createSnapshotTestFilesFunction · 0.85
resetSnapshotFlagsFunction · 0.85
captureSnapshotOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected