#!/usr/bin/env bash # Test harness for docker/scripts/bash-guard-hook.sh. # # Feeds each command to the hook (via the same JSON stdin contract Claude # Code uses) and asserts the expected exit code. # # Run: # bash docker/scripts/tests/bash-guard-tests.sh # # Exit 0 on full pass, 1 on any failure. set -u HOOK="$(cd "$(dirname "$0")/.." && pwd)/bash-guard-hook.sh" if [[ ! -x "$HOOK" ]]; then # chmod may not have been applied in the dev checkout — run via bash. HOOK="bash $HOOK" fi PASS=0 FAIL=0 FAILS=() # run_case