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

Function TestExtractFrontmatter_WithWhitespace

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

Source from the content-addressed store, hash-verified

322}
323
324func TestExtractFrontmatter_WithWhitespace(t *testing.T) {
325 content := []byte(`---
326id: "007"
327title: "Whitespace Test"
328---
329
330Body with leading/trailing whitespace
331
332`)
333
334 frontmatter, body, err := extractFrontmatter(content)
335 if err != nil {
336 t.Fatalf("expected no error, got: %v", err)
337 }
338
339 if len(frontmatter) == 0 {
340 t.Error("expected frontmatter")
341 }
342
343 if body != "Body with leading/trailing whitespace" {
344 t.Errorf("expected trimmed body, got '%s'", body)
345 }
346}
347
348func TestParseTaskContent_DeriveIDFromFilename(t *testing.T) {
349 content := []byte(`---

Callers

nothing calls this directly

Calls 2

extractFrontmatterFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected