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

Function TestExtractFrontmatter_NoFrontmatter

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

Source from the content-addressed store, hash-verified

305}
306
307func TestExtractFrontmatter_NoFrontmatter(t *testing.T) {
308 content := []byte("Just plain content")
309
310 frontmatter, body, err := extractFrontmatter(content)
311 if err != nil {
312 t.Fatalf("expected no error, got: %v", err)
313 }
314
315 if len(frontmatter) != 0 {
316 t.Error("expected empty frontmatter")
317 }
318
319 if body != "Just plain content" {
320 t.Errorf("expected body to be full content, got '%s'", body)
321 }
322}
323
324func TestExtractFrontmatter_WithWhitespace(t *testing.T) {
325 content := []byte(`---

Callers

nothing calls this directly

Calls 2

extractFrontmatterFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected