(t *testing.T)
| 310 | } |
| 311 | |
| 312 | func TestRunGet_DuplicateIDError(t *testing.T) { |
| 313 | tmpDir := createDuplicateTestFiles(t) |
| 314 | resetGetFlags() |
| 315 | taskDir = tmpDir |
| 316 | |
| 317 | err := runGet(getCmd, []string{"042"}) |
| 318 | if err == nil { |
| 319 | t.Fatal("expected error for duplicate ID, got nil") |
| 320 | } |
| 321 | if !strings.Contains(err.Error(), "duplicate task ID") { |
| 322 | t.Errorf("expected 'duplicate task ID' error, got: %v", err) |
| 323 | } |
| 324 | if !strings.Contains(err.Error(), "042") { |
| 325 | t.Errorf("expected error to mention ID 042, got: %v", err) |
| 326 | } |
| 327 | if !strings.Contains(err.Error(), "Task A") { |
| 328 | t.Errorf("expected error to mention title 'Task A', got: %v", err) |
| 329 | } |
| 330 | if !strings.Contains(err.Error(), "Task B") { |
| 331 | t.Errorf("expected error to mention title 'Task B', got: %v", err) |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | func TestRunGet_DuplicateID_UniqueTaskWorks(t *testing.T) { |
| 336 | tmpDir := createDuplicateTestFiles(t) |
nothing calls this directly
no test coverage detected