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

Function TestRunSet_DuplicateIDError

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

Source from the content-addressed store, hash-verified

366}
367
368func TestRunSet_DuplicateIDError(t *testing.T) {
369 tmpDir := createDuplicateTestFiles(t)
370
371 taskDir = tmpDir
372 setTaskID = "042"
373 setStatus = "completed"
374 setPriority = ""
375 setEffort = ""
376 setType = ""
377 setOwner = ""
378 setParent = ""
379 setDone = false
380 setDryRun = false
381 setVerify = false
382 setAddTags = nil
383 setRemoveTags = nil
384 setAddPRs = nil
385 setRemovePRs = nil
386 setAddTouches = nil
387 setRemoveTouches = nil
388 setDependsOn = ""
389
390 err := runSet(setCmd, []string{"042"})
391 if err == nil {
392 t.Fatal("expected error for duplicate ID, got nil")
393 }
394 if !strings.Contains(err.Error(), "refusing to modify") {
395 t.Errorf("expected 'refusing to modify' error, got: %v", err)
396 }
397 if !strings.Contains(err.Error(), "042") {
398 t.Errorf("expected error to mention ID 042, got: %v", err)
399 }
400}
401
402func TestRunRm_DuplicateIDError(t *testing.T) {
403 tmpDir := createDuplicateTestFiles(t)

Callers

nothing calls this directly

Calls 3

createDuplicateTestFilesFunction · 0.85
runSetFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected