fix: parse task headings with dash variants

This commit is contained in:
2026-06-01 19:25:59 +01:00
parent dede6ecc60
commit bc027a5423
3 changed files with 32 additions and 1 deletions
+30
View File
@@ -18,6 +18,36 @@ def test_get_next_task(tmp_path: Path) -> None:
assert task.title == "Second"
def test_get_next_task_with_em_dash(tmp_path: Path) -> None:
(tmp_path / "TASKS.md").write_text(
"# TASKS.md\n\n"
"## TASK-001 — First\nStatus: Done\n\n"
"## TASK-002 — Second\nStatus: Todo\n\n",
encoding="utf-8",
)
task = get_next_task(tmp_path)
assert task is not None
assert task.task_id == "TASK-002"
assert task.title == "Second"
def test_get_next_task_with_en_dash(tmp_path: Path) -> None:
(tmp_path / "TASKS.md").write_text(
"# TASKS.md\n\n"
"## TASK-001 First\nStatus: Done\n\n"
"## TASK-002 Second\nStatus: Todo\n\n",
encoding="utf-8",
)
task = get_next_task(tmp_path)
assert task is not None
assert task.task_id == "TASK-002"
assert task.title == "Second"
def test_update_task_status(tmp_path: Path) -> None:
tasks = tmp_path / "TASKS.md"
tasks.write_text(