diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-21 12:49:54 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-22 15:11:02 -0400 |
| commit | eeabf6216fde5f387d6173da93d0df882ed8a34e (patch) | |
| tree | 1aab8a2fdba5f13199eeea6caebb7bea7b271670 /test/test-abstraction-db.sh | |
| parent | check: warn when document's languages ocn diverge (diff) | |
test: ocn alignment check
Asserts the two known divergences in live-manual's translations by name
and value: ja two objects short of en, and pl's ocn 313 a paragraph in
English and a heading in Polish.
It asserts that nothing else is reported: exactly one document warned
about, exactly two languages of it.
Also the exit codes: 0 without --strict, non-zero with it on the
diverging document, and 0 with it on a single language document.
It will fail when those two translations are mended, which is the right
moment to hear about it, and the message names the expectation that went
stale.
test-abstraction-db.sh excludes translation.ocn_aligned from its header
block comparison, with the other two keys that are the database's notes
about the artefact rather than properties of the document.
(assisted by Claude-Code)
Diffstat (limited to 'test/test-abstraction-db.sh')
| -rwxr-xr-x | test/test-abstraction-db.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/test-abstraction-db.sh b/test/test-abstraction-db.sh index 2fac414..78c27b9 100755 --- a/test/test-abstraction-db.sh +++ b/test/test-abstraction-db.sh @@ -234,7 +234,11 @@ for ssp in $(find "$OUT_DIR/pod" -name "*.ssp" 2>/dev/null | sort); do done # the header blocks: every @source/@meta/@make/@doc_has property in the .ssp - # must be in the database under its own key, with the same value. this is + # must be in the database under its own key, with the same value. the three + # excluded keys are the database's own notes about the artefact rather than + # properties of the document: what it was built from (source.filename, + # source.ssp_digest) and how its languages compared once they had all been + # read (translation.ocn_aligned), which no single .ssp can state. this is # what catches a header property that reaches one artefact and not the # other, which a count of objects cannot see. awk ' @@ -249,7 +253,7 @@ for ssp in $(find "$OUT_DIR/pod" -name "*.ssp" 2>/dev/null | sort); do ' "$ssp" | sort > "$OUT_DIR/.sspmeta.$$" sqlite3 -separator "$(printf '\t')" "$db" \ "select key, value from metadata where doc_id=$did and key not in - ('source.filename','source.ssp_digest');" \ + ('source.filename','source.ssp_digest','translation.ocn_aligned');" \ 2>/dev/null | sort > "$OUT_DIR/.dbmeta.$$" if ! diff -q "$OUT_DIR/.sspmeta.$$" "$OUT_DIR/.dbmeta.$$" > /dev/null 2>&1; then [ $doc_fail -eq 0 ] && echo "$base" |
