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

Function captureDedup

apps/cli/internal/cli/deduplicate_test.go:28–43  ·  view source on GitHub ↗
(t *testing.T, dir string)

Source from the content-addressed store, hash-verified

26}
27
28func captureDedup(t *testing.T, dir string) (string, error) {
29 t.Helper()
30
31 oldStdout := os.Stdout
32 r, w, _ := os.Pipe()
33 os.Stdout = w
34
35 err := runDeduplicate(deduplicateCmd, []string{dir})
36
37 w.Close()
38 os.Stdout = oldStdout
39
40 var buf bytes.Buffer
41 buf.ReadFrom(r)
42 return buf.String(), err
43}
44
45func TestDeduplicate_NoDuplicates(t *testing.T) {
46 tmpDir := t.TempDir()

Calls 1

runDeduplicateFunction · 0.85

Tested by

no test coverage detected