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

Function TestParseTaskContent_MissingTitle

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

Source from the content-addressed store, hash-verified

267}
268
269func TestParseTaskContent_MissingTitle(t *testing.T) {
270 content := []byte(`---
271id: "005"
272---
273
274Body
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
290func TestParseTaskContent_EmptyBody(t *testing.T) {
291 content := []byte(`---

Callers

nothing calls this directly

Calls 3

ParseTaskContentFunction · 0.85
ErrorMethod · 0.80
containsFunction · 0.70

Tested by

no test coverage detected