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

Function TestRm_WithForce

apps/cli/internal/cli/rm_test.go:80–104  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

78}
79
80func TestRm_WithForce(t *testing.T) {
81 tmpDir := createRmTestFiles(t)
82 resetRmFlags()
83 taskDir = tmpDir
84 rmForce = true
85
86 output, err := captureRmOutput(t, []string{"001"})
87 if err != nil {
88 t.Fatalf("unexpected error: %v", err)
89 }
90
91 if !strings.Contains(output, "Deleted 1 task") {
92 t.Errorf("expected delete confirmation, got: %s", output)
93 }
94
95 // File should be gone
96 if _, err := os.Stat(filepath.Join(tmpDir, "001-setup.md")); !os.IsNotExist(err) {
97 t.Error("expected file to be deleted")
98 }
99
100 // Other file should remain
101 if _, err := os.Stat(filepath.Join(tmpDir, "002-old.md")); err != nil {
102 t.Error("expected other file to remain")
103 }
104}
105
106func TestRm_DryRun(t *testing.T) {
107 tmpDir := createRmTestFiles(t)

Callers

nothing calls this directly

Calls 4

createRmTestFilesFunction · 0.85
resetRmFlagsFunction · 0.85
captureRmOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected