Files
stack/agents/darkwing/work/queue-76-review/r1/m2.sh
T

21 lines
1.2 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# The four survivors of mutants.sh, rerun against the other test files that could catch them.
set -u
M=$1
W=packages/webui
P=$W/src/public/bus.js A=$W/src/public/app.js
run() { # name file from to testfile...
local name=$1 f=$2 from=$3 to=$4; shift 4
for t in "$@"; do
echo "== $name on $t"
if ! node "$M" "$f" "$from" "$to"; then echo "$name: DID NOT APPLY"; return; fi
node --test "$W/tests/$t.test.mjs" 2>&1 | grep -E '^ℹ (pass|fail)|^✖ ' | grep -v '^✖ failing tests' | sort -u | sed "s/^/$name: /"
git checkout -q -- "$f"; echo "restored"
done
}
run page-caret-lost "$P" " if (k.caret && el.tagName === 'TEXTAREA') { el.setSelectionRange(k.caret[0], k.caret[1]); el.scrollTop = k.caret[2]; }" '' bus-browser
run page-no-config-gate "$P" "if (c?.send === true) {" "if (c) {" send-browser shell
run page-composer-always "$P" " if (!canSend) return '';" '' send-browser shell
run app-reply-4xx-unknown "$A" 'const refused = err.status >= 400 && err.status < 500;' 'const refused = false;' return-flow browser-edge history-return-flow shell
run app-reply-5xx-refused "$A" 'const refused = err.status >= 400 && err.status < 500;' 'const refused = err.status >= 400;' return-flow browser-edge