a73x

ab4e375d

test: e2e refuse bound derives from the usage block

a73x   2026-08-09 12:21

Commit message
test: e2e refuse bound derives from the usage block

test/e2e.sh
Old New
@@ -402,10 +402,13 @@ refuse() {
402 } 402 }
403 # One line of complaint plus the usage block, and not a stack trace: a 403 # One line of complaint plus the usage block, and not a stack trace: a
404 # Zig panic runs to dozens of lines and names a source file, which is 404 # Zig panic runs to dozens of lines and names a source file, which is
405 # what this is guarding against. The bound tracks the usage text, which 405 # what this is guarding against. Derived from the usage text rather than
406 # grows a line per subcommand (keygen made it 8, so a refusal prints 9); 406 # written as a constant, so adding a subcommand moves the bound with it
407 # keep it comfortably above that and far below a panic. 407 # instead of silently spending headroom a later one would need. The
408 [ "$(wc -l < "$OUT.q")" -le 12 ] || { 408 # margin is 2 because a refusal is the complaint plus usage; the
409 # smallest Debug panic is ~20 lines, well clear of it.
410 _usage_lines=$("$MUXD" 2>&1 | wc -l)
411 [ "$(wc -l < "$OUT.q")" -le $((_usage_lines + 2)) ] || {
409 echo "e2e FAIL: muxd run $* answered with more than a message:"; cat "$OUT.q"; exit 1; 412 echo "e2e FAIL: muxd run $* answered with more than a message:"; cat "$OUT.q"; exit 1;
410 } 413 }
411 } 414 }