diff --git a/tests/test-plugin-content-consumer-neutral.sh b/tests/test-plugin-content-consumer-neutral.sh index 8258129..d0f2b81 100755 --- a/tests/test-plugin-content-consumer-neutral.sh +++ b/tests/test-plugin-content-consumer-neutral.sh @@ -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