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

Function createDuplicateTestFiles

apps/cli/internal/cli/duplicate_test.go:176–240  ·  view source on GitHub ↗

Helper to create task files with duplicate IDs for integration tests.

(t *testing.T)

Source from the content-addressed store, hash-verified

174
175// Helper to create task files with duplicate IDs for integration tests.
176func createDuplicateTestFiles(t *testing.T) string {
177 t.Helper()
178 tmpDir := t.TempDir()
179
180 groupA := filepath.Join(tmpDir, "groupA")
181 groupB := filepath.Join(tmpDir, "groupB")
182 if err := os.MkdirAll(groupA, 0755); err != nil {
183 t.Fatal(err)
184 }
185 if err := os.MkdirAll(groupB, 0755); err != nil {
186 t.Fatal(err)
187 }
188
189 taskA := `---
190id: "042"
191title: "Task A"
192status: pending
193priority: high
194effort: small
195dependencies: []
196tags: []
197created: 2026-02-08
198---
199
200# Task A
201`
202 taskB := `---
203id: "042"
204title: "Task B"
205status: pending
206priority: medium
207effort: medium
208dependencies: []
209tags: []
210created: 2026-02-08
211---
212
213# Task B
214`
215 uniqueTask := `---
216id: "001"
217title: "Unique Task"
218status: pending
219priority: low
220effort: small
221dependencies: []
222tags: []
223created: 2026-02-08
224---
225
226# Unique Task
227`
228
229 for name, content := range map[string]string{
230 filepath.Join(groupA, "042-task-a.md"): taskA,
231 filepath.Join(groupB, "042-task-b.md"): taskB,
232 filepath.Join(tmpDir, "001-unique.md"): uniqueTask,
233 } {

Calls

no outgoing calls

Tested by

no test coverage detected