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

Function createGetTestFilesWithSubdirs

apps/cli/internal/cli/get_test.go:476–535  ·  view source on GitHub ↗

--- File path matching tests ---

(t *testing.T)

Source from the content-addressed store, hash-verified

474// --- File path matching tests ---
475
476func createGetTestFilesWithSubdirs(t *testing.T) string {
477 t.Helper()
478
479 tmpDir := t.TempDir()
480
481 dirs := []string{"cli", "backend"}
482 for _, d := range dirs {
483 if err := os.MkdirAll(filepath.Join(tmpDir, d), 0755); err != nil {
484 t.Fatalf("Failed to create directory %s: %v", d, err)
485 }
486 }
487
488 files := map[string]string{
489 "cli/042-task.md": `---
490id: "cli-042"
491title: "CLI task"
492status: pending
493priority: medium
494dependencies: []
495tags: []
496created: 2026-02-08
497---
498
499# CLI task
500`,
501 "backend/055-api.md": `---
502id: "backend-055"
503title: "API task"
504status: pending
505priority: high
506dependencies: []
507tags: []
508created: 2026-02-08
509---
510
511# API task
512`,
513 "cli/055-api.md": `---
514id: "cli-055"
515title: "CLI API task"
516status: pending
517priority: low
518dependencies: []
519tags: []
520created: 2026-02-08
521---
522
523# CLI API task
524`,
525 }
526
527 for relPath, content := range files {
528 path := filepath.Join(tmpDir, relPath)
529 if err := os.WriteFile(path, []byte(content), 0644); err != nil {
530 t.Fatalf("Failed to create test file %s: %v", relPath, err)
531 }
532 }
533

Calls

no outgoing calls

Tested by

no test coverage detected