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

Function TestAdd_SequentialIDs

apps/cli/internal/cli/add_test.go:302–333  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

300}
301
302func TestAdd_SequentialIDs(t *testing.T) {
303 tmpDir := t.TempDir()
304
305 // Create an existing task file
306 existing := `---
307id: "005"
308title: "Existing task"
309status: pending
310priority: medium
311dependencies: []
312tags: []
313created: 2026-02-16
314---
315
316# Existing task
317`
318 if err := os.WriteFile(filepath.Join(tmpDir, "005-existing.md"), []byte(existing), 0644); err != nil {
319 t.Fatal(err)
320 }
321
322 resetAddFlags()
323 taskDir = tmpDir
324
325 output, err := captureAddOutput(t, "Next task")
326 if err != nil {
327 t.Fatalf("unexpected error: %v", err)
328 }
329
330 if !strings.Contains(output, "Created task 006") {
331 t.Errorf("expected ID 006 (next after 005), got: %s", output)
332 }
333}
334
335func TestAdd_DependsOnParsing(t *testing.T) {
336 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 2

resetAddFlagsFunction · 0.85
captureAddOutputFunction · 0.85

Tested by

no test coverage detected