(t *testing.T)
| 1332 | } |
| 1333 | |
| 1334 | func TestHandleProjects_NilLoader(t *testing.T) { |
| 1335 | req := httptest.NewRequest(http.MethodGet, "/api/projects", nil) |
| 1336 | rec := httptest.NewRecorder() |
| 1337 | |
| 1338 | handleProjects(nil)(rec, req) |
| 1339 | |
| 1340 | if rec.Code != http.StatusOK { |
| 1341 | t.Fatalf("expected 200, got %d", rec.Code) |
| 1342 | } |
| 1343 | |
| 1344 | var result []ProjectEntry |
| 1345 | if err := json.Unmarshal(rec.Body.Bytes(), &result); err != nil { |
| 1346 | t.Fatalf("invalid JSON: %v", err) |
| 1347 | } |
| 1348 | if len(result) != 0 { |
| 1349 | t.Fatalf("expected empty list, got %d", len(result)) |
| 1350 | } |
| 1351 | } |
| 1352 | |
| 1353 | func TestHandleTasks_WithProject(t *testing.T) { |
| 1354 | defaultDir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected