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

Function TestEdge_Set_DryRunNoWrite

apps/cli/internal/cli/edge_cases_test.go:234–257  ·  view source on GitHub ↗

--- Set command: dry-run ---

(t *testing.T)

Source from the content-addressed store, hash-verified

232// --- Set command: dry-run ---
233
234func TestEdge_Set_DryRunNoWrite(t *testing.T) {
235 tmpDir := createEdgeCaseTestFiles(t)
236 resetSetFlags()
237 taskDir = tmpDir
238 setTaskID = "001"
239 setStatus = "completed"
240 setDryRun = true
241 defer func() { setDryRun = false }()
242
243 output, err := captureSetOutput(t)
244 if err != nil {
245 t.Fatalf("unexpected error: %v", err)
246 }
247
248 if !strings.Contains(output, "Dry run") {
249 t.Error("expected 'Dry run' message in output")
250 }
251
252 // Verify file was NOT changed
253 content, _ := os.ReadFile(filepath.Join(tmpDir, "001-task.md"))
254 if strings.Contains(string(content), "status: completed") {
255 t.Error("expected file NOT to be modified during dry run")
256 }
257}
258
259// --- Graph: conflicting flags ---
260

Callers

nothing calls this directly

Calls 4

createEdgeCaseTestFilesFunction · 0.85
resetSetFlagsFunction · 0.85
captureSetOutputFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected