(t *testing.T)
| 246 | } |
| 247 | |
| 248 | func TestParseTaskContent_MissingID(t *testing.T) { |
| 249 | content := []byte(`--- |
| 250 | title: "No ID" |
| 251 | --- |
| 252 | |
| 253 | Body |
| 254 | `) |
| 255 | |
| 256 | _, err := ParseTaskContent("no-id.md", content) |
| 257 | if err == nil { |
| 258 | t.Error("expected error for missing ID") |
| 259 | } |
| 260 | |
| 261 | parseErr, ok := err.(*ParseError) |
| 262 | if !ok { |
| 263 | t.Errorf("expected ParseError, got %T", err) |
| 264 | } else if !contains(parseErr.Message, "required fields") { |
| 265 | t.Errorf("expected error message to mention required fields, got: %s", parseErr.Message) |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | func TestParseTaskContent_MissingTitle(t *testing.T) { |
| 270 | content := []byte(`--- |
nothing calls this directly
no test coverage detected