(t *testing.T)
| 128 | } |
| 129 | |
| 130 | func TestCmdEditAmbiguousSameSlug(t *testing.T) { |
| 131 | // Same slug in tasks and projects → must surface as ambiguity. |
| 132 | root, db := showListEditDB(t) |
| 133 | insertProject(t, db, "twin", "Twin", filepath.Join(root, "x"), "medium") |
| 134 | insertTask(t, db, "twin", "Twin", "backlog", "medium", filepath.Join(root, "x"), nil) |
| 135 | |
| 136 | os.Setenv("EDITOR", "true") |
| 137 | t.Cleanup(func() { os.Unsetenv("EDITOR") }) |
| 138 | out := captureStdout(t, func() { |
| 139 | if rc := cmdEdit([]string{"twin"}); rc != 1 { |
| 140 | t.Errorf("rc=%d, want 1", rc) |
| 141 | } |
| 142 | }) |
| 143 | if !strings.Contains(out, "ambiguous") { |
| 144 | t.Errorf("missing ambiguity error; out=%q", out) |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | func TestCmdEditNamespacePrefix(t *testing.T) { |
| 149 | // task/<slug> and project/<slug> prefixes disambiguate. |
nothing calls this directly
no test coverage detected