(t *testing.T)
| 135 | } |
| 136 | |
| 137 | func TestTaskCRUD(t *testing.T) { |
| 138 | db := openTempDB(t) |
| 139 | insertProject(t, db, "proj", "Proj", "/tmp/proj", "medium") |
| 140 | insertTask(t, db, "work", "Some Work", "backlog", "medium", "/tmp/proj", "proj") |
| 141 | got, err := GetTask(db, "work") |
| 142 | if err != nil { |
| 143 | t.Fatalf("GetTask: %v", err) |
| 144 | } |
| 145 | if got.Slug != "work" || !got.ProjectSlug.Valid || got.ProjectSlug.String != "proj" { |
| 146 | t.Errorf("unexpected task: %+v", got) |
| 147 | } |
| 148 | // Backlog floating task (no project, no session_id — both NULL is |
| 149 | // allowed for backlog under the session-id invariant). |
| 150 | insertTask(t, db, "float", "Floating", "backlog", "high", "/tmp/float", nil) |
| 151 | floating, err := GetTask(db, "float") |
| 152 | if err != nil { |
| 153 | t.Fatalf("GetTask floating: %v", err) |
| 154 | } |
| 155 | if floating.ProjectSlug.Valid { |
| 156 | t.Errorf("expected null project_slug") |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func TestWorkdirUpsert(t *testing.T) { |
| 161 | db := openTempDB(t) |
nothing calls this directly
no test coverage detected