1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 17:24:45 +00:00

test: fix empty directory cleanup depth and remove obsolete spinner test

This commit is contained in:
Tw93
2026-01-03 13:37:53 +08:00
parent a57cd22abf
commit 5ee7d2d703
2 changed files with 3 additions and 13 deletions

View File

@@ -42,8 +42,8 @@ clean_empty_library_items() {
for location in "${key_locations[@]}"; do for location in "${key_locations[@]}"; do
[[ -d "$location" ]] || continue [[ -d "$location" ]] || continue
# Limit passes to keep cleanup fast; one extra pass catches most parents. # Limit passes to keep cleanup fast; 3 iterations handle most nested scenarios.
local max_iterations=2 local max_iterations=3
local iteration=0 local iteration=0
while [[ $iteration -lt $max_iterations ]]; do while [[ $iteration -lt $max_iterations ]]; do

View File

@@ -25,21 +25,11 @@ setup() {
mkdir -p "$HOME" mkdir -p "$HOME"
} }
teardown() { @test "mo_spinner_chars returns default sequence" {
unset MO_SPINNER_CHARS || true
}
@test "mo_spinner_chars returns default sequence when unset" {
result="$(HOME="$HOME" bash --noprofile --norc -c "source '$PROJECT_ROOT/lib/core/common.sh'; mo_spinner_chars")" result="$(HOME="$HOME" bash --noprofile --norc -c "source '$PROJECT_ROOT/lib/core/common.sh'; mo_spinner_chars")"
[ "$result" = "|/-\\" ] [ "$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" { @test "detect_architecture maps current CPU to friendly label" {
expected="Intel" expected="Intel"
if [[ "$(uname -m)" == "arm64" ]]; then if [[ "$(uname -m)" == "arm64" ]]; then