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

Function TestResolve_Deduplication

apps/cli/internal/taskcontext/resolve_test.go:83–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestResolve_Deduplication(t *testing.T) {
84 root := t.TempDir()
85 writeFile(t, root, "src/main.go", "package main\n")
86
87 task := &model.Task{
88 ID: "004",
89 Title: "Dedup task",
90 Touches: []string{"cli"},
91 Context: []string{"src/main.go"},
92 }
93 scopes := ScopeMap{"cli": {"src/main.go"}}
94
95 result, err := Resolve(task, Options{Scopes: scopes, ProjectRoot: root})
96 if err != nil {
97 t.Fatalf("unexpected error: %v", err)
98 }
99
100 if len(result.Files) != 1 {
101 t.Fatalf("expected 1 file after dedup, got %d", len(result.Files))
102 }
103 // Scope entry comes first, so it wins
104 assertFileEntry(t, result.Files[0], "src/main.go", "scope:cli", true)
105}
106
107func TestResolve_DirectoryExpansion(t *testing.T) {
108 root := t.TempDir()

Callers

nothing calls this directly

Calls 3

assertFileEntryFunction · 0.85
writeFileFunction · 0.70
ResolveFunction · 0.70

Tested by

no test coverage detected