test(plugins): guard the consumer-neutral test's array expansion

test-vale-wrap's bash 3.2 scan flags a bare "${arr[@]}" expansion under
set -u. Use the guarded form the repo's other scripts use.

Refs: #177

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-12-06 22:18:55 +00:00
1 parent 05dffc3e45
commit 75ec543b4b
1 file changed
+3 -2
@@ -35,8 +35,9 @@ assert_absent() {
fi
dirs+=("plugins/$plugin/.apm")
done
# grep exits 1 on no match, which is the passing case here.
hits="$(cd "$REPO_ROOT" && grep -rnI $flags -e "$pattern" -- "${dirs[@]}" || true)"
# grep exits 1 on no match, which is the passing case here. The guarded
# expansion keeps bash 3.2 happy under `set -u`.
hits="$(cd "$REPO_ROOT" && grep -rnI $flags -e "$pattern" -- ${dirs[@]+"${dirs[@]}"} || true)"
if [[ -z "$hits" ]]; then
pass "$label"
else