diff --git a/lib/clean/user.sh b/lib/clean/user.sh index 9cc616f..26fe25d 100644 --- a/lib/clean/user.sh +++ b/lib/clean/user.sh @@ -42,8 +42,8 @@ clean_empty_library_items() { for location in "${key_locations[@]}"; do [[ -d "$location" ]] || continue - # Limit passes to keep cleanup fast; one extra pass catches most parents. - local max_iterations=2 + # Limit passes to keep cleanup fast; 3 iterations handle most nested scenarios. + local max_iterations=3 local iteration=0 while [[ $iteration -lt $max_iterations ]]; do diff --git a/tests/core_common.bats b/tests/core_common.bats index 105a4ca..0bb6efa 100644 --- a/tests/core_common.bats +++ b/tests/core_common.bats @@ -25,21 +25,11 @@ setup() { mkdir -p "$HOME" } -teardown() { - unset MO_SPINNER_CHARS || true -} - -@test "mo_spinner_chars returns default sequence when unset" { +@test "mo_spinner_chars returns default sequence" { result="$(HOME="$HOME" bash --noprofile --norc -c "source '$PROJECT_ROOT/lib/core/common.sh'; mo_spinner_chars")" [ "$result" = "|/-\\" ] } -@test "mo_spinner_chars respects MO_SPINNER_CHARS override" { - export MO_SPINNER_CHARS="abcd" - result="$(HOME="$HOME" MO_SPINNER_CHARS="$MO_SPINNER_CHARS" bash --noprofile --norc -c "source '$PROJECT_ROOT/lib/core/common.sh'; mo_spinner_chars")" - [ "$result" = "abcd" ] -} - @test "detect_architecture maps current CPU to friendly label" { expected="Intel" if [[ "$(uname -m)" == "arm64" ]]; then