test(ingest): Add tests for slug validation and index-append updates
This commit is contained in:
parent
3272450ec5
commit
9a81bb2d6f
1 changed files with 15 additions and 0 deletions
|
|
@ -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-"* ]]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue