(t *testing.T)
| 225 | } |
| 226 | |
| 227 | func TestParseTaskContent_UnclosedFrontmatter(t *testing.T) { |
| 228 | content := []byte(`--- |
| 229 | id: "004" |
| 230 | title: "Unclosed" |
| 231 | |
| 232 | This has no closing delimiter |
| 233 | `) |
| 234 | |
| 235 | _, err := ParseTaskContent("unclosed.md", content) |
| 236 | if err == nil { |
| 237 | t.Error("expected error for unclosed frontmatter") |
| 238 | } |
| 239 | |
| 240 | parseErr, ok := err.(*ParseError) |
| 241 | if !ok { |
| 242 | t.Errorf("expected ParseError, got %T", err) |
| 243 | } else if !contains(parseErr.Message, "frontmatter") { |
| 244 | t.Errorf("expected error message to mention frontmatter, got: %s", parseErr.Message) |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | func TestParseTaskContent_MissingID(t *testing.T) { |
| 249 | content := []byte(`--- |
nothing calls this directly
no test coverage detected