test(ingest): Add tests for slug validation and index-append updates

This commit is contained in:
Matteo Cherubini 2026-06-05 09:59:18 +02:00
parent 3272450ec5
commit 9a81bb2d6f

View file

@ -51,3 +51,18 @@ load helpers
python3 "$SKILL_SCRIPTS/index-append.py" --section Sources --entry '- [[sources/dup]] — d. `maturity: draft`'
[ "$(grep -c 'sources/dup' wiki/index.md)" -eq 1 ]
}
@test "index-append: updates an existing entry by wikilink path (no duplicate)" {
G="$(make_fixture_genome)"; cd "$G"
python3 "$SKILL_SCRIPTS/index-append.py" --section Sources --entry '- [[sources/foo]] — old summary. `maturity: draft`'
python3 "$SKILL_SCRIPTS/index-append.py" --section Sources --entry '- [[sources/foo]] — new summary. `maturity: stable`'
[ "$(grep -c 'sources/foo' wiki/index.md)" -eq 1 ]
grep -q 'new summary' wiki/index.md
! grep -q 'old summary' wiki/index.md
}
@test "slug: refuses an all-symbols input (no empty slug)" {
run bash "$SKILL_SCRIPTS/slug.sh" "!!!.md"
[ "$status" -ne 0 ]
[ -z "$output" ] || [[ "$output" != *"feat/ai-ingest-"* ]]
}