diff --git a/lib/tests/a11y-scan.test.sh b/lib/tests/a11y-scan.test.sh new file mode 100755 index 0000000..bdf6944 --- /dev/null +++ b/lib/tests/a11y-scan.test.sh @@ -0,0 +1,130 @@ +#!/usr/bin/env bash +# lib/tests/a11y-scan.test.sh — floor of the /a11y scanner catalogue. +# The clean fixture must scan with zero FAIL and zero WARN. Each mutant breaks +# one rule on a copy of it and must raise that rule at the expected severity +# (positive control). The A11Y-CLEAR / A11Y-NO-NEW markers, the gates.sh +# contract wiring and the rejection of guardrails rules are checked too; the +# shared engine itself is proven in guardrails-scan.test.sh. +# shellcheck disable=SC2016 +set -u +ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +SCAN="$ROOT/skills/a11y/scripts/scan.py" +GOOD="$ROOT/lib/tests/fixtures/a11y-good" +WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT +PASS=0; FAIL=0; LAST_OUT=""; LAST_RC=0 + +check() { # check