diff options
| -rwxr-xr-x | .extras/test-build | 9 | ||||
| -rw-r--r-- | .extras/test-logic.sh | 7 |
2 files changed, 15 insertions, 1 deletions
diff --git a/.extras/test-build b/.extras/test-build index ecd763f..018030e 100755 --- a/.extras/test-build +++ b/.extras/test-build @@ -285,7 +285,14 @@ apply_overrides_to_order() { [[ "${OV_DROP[$prog]:-}" == "1" ]] && continue keep+=("$d") done - RESOLVED_ORDER=("${keep[@]:-}") + # Assign without "${keep[@]:-}": under set -u that fallback yields a + # one-element array holding an empty string when keep is empty (all deps + # dropped), which the build loop would then iterate over as d="". Guard it. + if [[ ${#keep[@]} -eq 0 ]]; then + RESOLVED_ORDER=() + else + RESOLVED_ORDER=("${keep[@]}") + fi } # ============================================================================= diff --git a/.extras/test-logic.sh b/.extras/test-logic.sh index 841793b..a05e990 100644 --- a/.extras/test-logic.sh +++ b/.extras/test-logic.sh @@ -98,6 +98,13 @@ apply_overrides_to_order kept=""; for x in "${RESOLVED_ORDER[@]}"; do kept+="$(basename "$x") "; done kept="${kept% }" [[ "$kept" == "keepme" ]] && ok "drop removes from order" || bad "drop failed, order=[$kept]" + +# all entries dropped -> RESOLVED_ORDER must be truly empty (not one "" element) +OV_DROP=([dropme]=1 [keepme]=1) +RESOLVED_ORDER=("$T/cat/dropme" "$T/cat/keepme") +apply_overrides_to_order +[[ ${#RESOLVED_ORDER[@]} -eq 0 ]] && ok "all-dropped -> empty order" || bad "all-dropped left ${#RESOLVED_ORDER[@]} elem(s): [${RESOLVED_ORDER[*]}]" +OV_DROP=() rm -f "$OV" # overrides only apply on current; on 15.0 they are a no-op |
