(t *testing.T)
| 267 | } |
| 268 | |
| 269 | func TestParseTaskContent_MissingTitle(t *testing.T) { |
| 270 | content := []byte(`--- |
| 271 | id: "005" |
| 272 | --- |
| 273 | |
| 274 | Body |
| 275 | `) |
| 276 | |
| 277 | _, err := ParseTaskContent("no-title.md", content) |
| 278 | if err == nil { |
| 279 | t.Error("expected error for missing title") |
| 280 | } |
| 281 | |
| 282 | parseErr, ok := err.(*ParseError) |
| 283 | if !ok { |
| 284 | t.Errorf("expected ParseError, got %T", err) |
| 285 | } else if !contains(parseErr.Message, "required fields") { |
| 286 | t.Errorf("expected error message to mention required fields, got: %s", parseErr.Message) |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | func TestParseTaskContent_EmptyBody(t *testing.T) { |
| 291 | content := []byte(`--- |
nothing calls this directly
no test coverage detected