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

Function TestAdd_DependsOnParsing

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

Source from the content-addressed store, hash-verified

333}
334
335func TestAdd_DependsOnParsing(t *testing.T) {
336 tmpDir := t.TempDir()
337 resetAddFlags()
338 taskDir = tmpDir
339 addDependsOn = "001, 002, 003"
340
341 _, err := captureAddOutput(t, "Dependent task")
342 if err != nil {
343 t.Fatalf("unexpected error: %v", err)
344 }
345
346 files, _ := filepath.Glob(filepath.Join(tmpDir, "001-*.md"))
347 if len(files) != 1 {
348 t.Fatalf("expected 1 file, got %d", len(files))
349 }
350
351 content, _ := os.ReadFile(files[0])
352 if !strings.Contains(string(content), `dependencies: ["001", "002", "003"]`) {
353 t.Errorf("expected dependencies list, got:\n%s", string(content))
354 }
355}
356
357func TestAdd_TagsParsing(t *testing.T) {
358 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 2

resetAddFlagsFunction · 0.85
captureAddOutputFunction · 0.85

Tested by

no test coverage detected