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

Function TestParseTaskContent_MissingID

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

Source from the content-addressed store, hash-verified

246}
247
248func TestParseTaskContent_MissingID(t *testing.T) {
249 content := []byte(`---
250title: "No ID"
251---
252
253Body
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
269func TestParseTaskContent_MissingTitle(t *testing.T) {
270 content := []byte(`---

Callers

nothing calls this directly

Calls 3

ParseTaskContentFunction · 0.85
ErrorMethod · 0.80
containsFunction · 0.70

Tested by

no test coverage detected