Golden tests verify taskmark parsing and mutation by comparing actual output against expected "golden" files.
tests/golden/
parse/ # Parse tests (50 tests)
basic/ # Task states, simple parsing, subtasks
metadata/ # Projects, tags, assignees, dates, custom fields
inheritance/ # Heading inheritance, provenance tracking
multifile/ # File links, circular detection
realworld/ # Realistic taskmark files
mutate/ # Mutation tests (18 tests)
basic/ # State changes, field updates
metadata/ # Tags, assignees, custom fields
multifile/ # Cross-file mutations
errors/ # Error cases
recurrence/ # Recurring task handling
Each test is a directory containing:
| File | Purpose |
|---|---|
input.md |
Markdown file to parse |
expected.yaml |
Expected TaskStore structure |
linked_*.md |
Secondary files (multifile only) |
_meta.yaml |
Test metadata (multifile only) |
parse/basic/simple/
input.md # - [ ] My task #tag
expected.yaml # tasks: [{title: "My task", tags: ["tag"], ...}]
Each test is a directory containing:
| File | Purpose |
|---|---|
input.md |
Starting markdown state |
mutation.yaml |
What to change |
expected.md |
Expected markdown after mutation |
linked_*.md |
Secondary input files (optional) |
expected_*.md |
Expected secondary files (optional) |
target:
title: "Task title"
project: "project/path" # Optional
changes:
state: done
tags: ["new-tag"]
expected_result:
status: success # success | partial | fail
options:
today: "2025-01-15" # Fixed date for determinismmutate/basic/mark_done/
input.md # - [ ] Fix bug
mutation.yaml # state: done
expected.md # - [x] 2025-01-15 Fix bug
# Run all golden tests
pytest tests/golden/test_golden.py -v
# Run only parse tests
pytest tests/golden/test_golden.py::test_parse -v
# Run only mutation tests
pytest tests/golden/test_golden.py::test_mutation -v- Create
tests/golden/parse/<category>/<name>/ - Add
input.mdandexpected.yaml - Run tests
- Create
tests/golden/mutate/<category>/<name>/ - Add
input.md,mutation.yaml,expected.md - Run tests