(t *testing.T)
| 322 | } |
| 323 | |
| 324 | func TestExtractFrontmatter_WithWhitespace(t *testing.T) { |
| 325 | content := []byte(`--- |
| 326 | id: "007" |
| 327 | title: "Whitespace Test" |
| 328 | --- |
| 329 | |
| 330 | Body 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 | |
| 348 | func TestParseTaskContent_DeriveIDFromFilename(t *testing.T) { |
| 349 | content := []byte(`--- |
nothing calls this directly
no test coverage detected