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/server/tests/counts-mutants.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 / server / tests / counts-mutants.sh` 30 lines ยท 1565 bytes Raw Blame History 1 #!/usr/bin/env bash 2 # server/tests/counts-mutants.sh: negative controls for server/tests/counts.sh. Each mutant breaks one 3 # rule of server/json.om / server/counts.om in the composed test copy (FORGE_TEST_MUTANT, a sed 4 # script); counts.sh must FAIL on every one. Prints KILLED or SURVIVED per mutant; exit 0 only when 5 # all are killed. Same cores and ports as counts.sh, one run after another. 6 set -u 7 cd "$(dirname "$0")/../.." 8 names=(own-filter-off bot-filter-off cursor-ignored no-journal-cursor accept-ignores-html status-ignored suffix-skips-allow-list no-tail-trim since-before-cursor) 9 muts=( 10 's/^if fzown add p1 1 p2$/if eq ulong 1 ulong 0/' 11 's/^if fzua ue e$/if eq ulong 1 ulong 0/' 12 's/^f = get fzoff s$/f = ulong 0/' 13 's/^fzjc 107$/fzjc 120/' 14 's/^ret not fjhas tfjth$/ret true/' 15 's/^if ne fznum add q2 2 e 200$/if eq ulong 1 ulong 0/' 16 '/^fn fjsfx /,/^ret 200$/ s/^if not fsetrepo$/if eq ulong 1 ulong 0/' 17 's/^if gt ulong sz get fzjend 0$/if eq ulong 1 ulong 0/' 18 's/^put fzspen s fznum add a 4 e$/put fzsnc s fznum add a 4 e/' 19 ) 20 killed=0; survived=0 21 for k in "${!muts[@]}"; do 22 out=$(FORGE_TEST_MUTANT=${muts[$k]} bash server/tests/counts.sh 2>&1); rc=$? 23 if [ "$rc" -ne 0 ] && ! echo "$out" | grep -q '^MUTANT did not apply'; then 24 killed=$((killed+1)); echo "KILLED ${names[$k]} (rc $rc): $(echo "$out" | grep -m2 '^FAIL' | tr '\n' ' ' | cut -c1-240)" 25 else 26 survived=$((survived+1)); echo "SURVIVED ${names[$k]} (rc $rc) $(echo "$out" | grep -m1 'MUTANT')" 27 fi 28 done 29 echo "counts-mutants: $killed killed, $survived survived" 30 [ "$survived" = 0 ]