From 3f23288296c70ab619cfd100a70b900a019b5f7e Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 3 May 2026 10:58:46 +0200 Subject: chore: add CLAUDE.md, HANDOFF.md, design spec, implementation plan, frontmatter fixes --- tests/test_frontmatter.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_frontmatter.py b/tests/test_frontmatter.py index 2257a8a..6cd4b44 100644 --- a/tests/test_frontmatter.py +++ b/tests/test_frontmatter.py @@ -1,6 +1,5 @@ import pytest from pathlib import Path -import tempfile from core.frontmatter import parse_frontmatter, write_frontmatter SAMPLE_MD = """\ @@ -42,6 +41,13 @@ def test_write_preserves_format(tmp_path): assert fm2["title"] == "Updated Title" assert fm2["type"] == "Tech" +def test_write_is_idempotent(tmp_path): + f = tmp_path / "index.md" + f.write_text(SAMPLE_MD) + fm, body = parse_frontmatter(f) + write_frontmatter(f, fm, body) + assert f.read_text() == SAMPLE_MD + def test_parse_raises_on_missing_delimiters(tmp_path): f = tmp_path / "index.md" f.write_text("# No frontmatter\n\nJust body.") -- cgit v1.2.3