MCPcopy Create free account
hub / github.com/driangle/taskmd / TestParseTaskContent_UnclosedFrontmatter

Function TestParseTaskContent_UnclosedFrontmatter

sdk/go/parser/markdown_test.go:227–246  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

225}
226
227func TestParseTaskContent_UnclosedFrontmatter(t *testing.T) {
228 content := []byte(`---
229id: "004"
230title: "Unclosed"
231
232This 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
248func TestParseTaskContent_MissingID(t *testing.T) {
249 content := []byte(`---

Callers

nothing calls this directly

Calls 3

ParseTaskContentFunction · 0.85
ErrorMethod · 0.80
containsFunction · 0.70

Tested by

no test coverage detected