(t *testing.T)
| 407 | } |
| 408 | |
| 409 | func TestHandleValidate(t *testing.T) { |
| 410 | dir := createTestTaskDir(t) |
| 411 | dp := NewDataProvider(dir, false) |
| 412 | |
| 413 | req := httptest.NewRequest(http.MethodGet, "/api/validate", nil) |
| 414 | rec := httptest.NewRecorder() |
| 415 | |
| 416 | handleValidate(dp)(rec, req) |
| 417 | |
| 418 | if rec.Code != http.StatusOK { |
| 419 | t.Fatalf("expected 200, got %d", rec.Code) |
| 420 | } |
| 421 | |
| 422 | var result validator.ValidationResult |
| 423 | if err := json.Unmarshal(rec.Body.Bytes(), &result); err != nil { |
| 424 | t.Fatalf("invalid JSON: %v", err) |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | // PUT /api/tasks/{id} tests |
| 429 |
nothing calls this directly
no test coverage detected