Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/interplane-forge/blob/main/galaxy/tests/run.sh # interplane-forge INTERPLANE Forge Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `interplane-forge / galaxy / tests / run.sh` 142 lines ยท 7397 bytes Raw Blame History 1 #!/bin/sh 2 # galaxy/tests/run.sh: gate for the galaxy filter (page.om + cli.om, the INTERPLANE front page). 3 # OMC=/abs/seed/out/omc sh galaxy/tests/run.sh 4 # Composes the two units, builds them with the pinned omc, runs the filter on tests/feed.tsv and 5 # checks the page it prints. 6 # Negative controls: a hostile input must come out escaped, and a mutant with the escape removed 7 # must FAIL that same check. Exit 0 only when every check passes; 2 on a compiler pin mismatch. 8 set -u 9 HERE=$(cd "$(dirname "$0")" && pwd) 10 G=$HERE/.. 11 OMC=${OMC:-$HOME/work/flux/omega-mv/seed/out/omc} 12 PIN=`3ad9f10f64309e7acf8a725082b28e23a2a4aeb07e98322fb4dc0fcd8fc93194` 13 T=$(mktemp -d) || exit 2 14 trap 'rm -rf "$T"' EXIT 15 SRC=$T/galaxy.om 16 cat "$G/page.om" "$G/cli.om" >"$SRC" 17 pass=0 18 fail=0 19 ok() { pass=$((pass + 1)); echo "PASS $1"; } 20 no() { fail=$((fail + 1)); echo "FAIL $1"; } 21 eq() { if [ "$2" = "$3" ]; then ok "$1"; else no "$1: got '$2' want '$3'"; fi; } 22 count() { grep -o "$1" "$2" | wc -l | tr -d ' '; } 23 24 got=$(sha256sum "$OMC" 2>/dev/null | cut -d' ' -f1) 25 if [ "$got" != "$PIN" ]; then 26 echo "compiler pin mismatch: $got" >&2 27 exit 2 28 fi 29 "$OMC" <"$SRC" >"$T/galaxy" 2>"$T/omc.err" 30 eq "compile exit" "$?" 0 31 chmod +x "$T/galaxy" 32 33 "$T/galaxy" <"$HERE/feed.tsv" >"$T/page.html" 34 eq "page exit" "$?" 0 35 eq "no script element" "$(grep -ci 'Retired" "$T/page.html")" 1 42 eq "merge rows equal M lines" "$(count '
  • "$T/page2.html" 49 eq "same input, same bytes" "$(sha256sum <"$T/page.html")" "$(sha256sum <"$T/page2.html")" 50 51 printf 'css\n' | "$T/galaxy" >"$T/galaxy.css" 52 eq "css exit" "$?" 0 53 eq "css has no markup" "$(grep -c '<' "$T/galaxy.css")" 0 54 eq "css types no colour" "$(grep -Eci '#[0-9a-f]{3,8}[;}]|rgba?\(|hsla?\(' "$T/galaxy.css")" 0 55 56 # hostile input: every field carries markup and a quote. and never occur in the page itself. 57 printf 'K\tdelivered\t\nS\ta b\t1\t1\nR\t">\tcore\nM\tr\t'"'"'onx\t