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

Function TestRunRm_DuplicateIDError

apps/cli/internal/cli/duplicate_test.go:402–419  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

400}
401
402func TestRunRm_DuplicateIDError(t *testing.T) {
403 tmpDir := createDuplicateTestFiles(t)
404
405 taskDir = tmpDir
406 rmForce = true
407 rmDryRun = false
408
409 err := runRm(rmCmd, []string{"042"})
410 if err == nil {
411 t.Fatal("expected error for duplicate ID, got nil")
412 }
413 if !strings.Contains(err.Error(), "refusing to delete") {
414 t.Errorf("expected 'refusing to delete' error, got: %v", err)
415 }
416 if !strings.Contains(err.Error(), "042") {
417 t.Errorf("expected error to mention ID 042, got: %v", err)
418 }
419}

Callers

nothing calls this directly

Calls 3

createDuplicateTestFilesFunction · 0.85
runRmFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected