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

Function TestTracks_OverlapSameTrack

apps/cli/internal/cli/tracks_test.go:205–243  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

203}
204
205func TestTracks_OverlapSameTrack(t *testing.T) {
206 tmpDir := createTracksTestTaskFiles(t)
207 resetTracksFlags()
208 tracksFormat = "json"
209
210 output, err := captureTracksOutput(t, []string{tmpDir})
211 if err != nil {
212 t.Fatalf("runTracks failed: %v", err)
213 }
214
215 var result tracks.Result
216 if err := json.Unmarshal([]byte(output), &result); err != nil {
217 t.Fatalf("Failed to parse JSON: %v", err)
218 }
219
220 // Tasks 002 and 003 both touch scope-a, so they must be in the same track (sequential).
221 task002Track := -1
222 task003Track := -1
223 for _, track := range result.Tracks {
224 for _, task := range track.Tasks {
225 if task.ID == "002" {
226 task002Track = track.ID
227 }
228 if task.ID == "003" {
229 task003Track = track.ID
230 }
231 }
232 }
233
234 if task002Track == -1 {
235 t.Error("Task 002 not found in any track")
236 }
237 if task003Track == -1 {
238 t.Error("Task 003 not found in any track")
239 }
240 if task002Track != task003Track {
241 t.Errorf("Tasks 002 and 003 share scope-a but are in different tracks (%d vs %d)", task002Track, task003Track)
242 }
243}
244
245func TestTracks_NonOverlappingShareTrack(t *testing.T) {
246 tmpDir := createTracksTestTaskFiles(t)

Callers

nothing calls this directly

Calls 4

resetTracksFlagsFunction · 0.85
captureTracksOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected