1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-12 07:38:59 +00:00

fix(uninstall): show full preview paths and add regression tests

This commit is contained in:
tw93
2026-02-11 14:22:22 +08:00
parent 649f638a53
commit 4c60fcca73
3 changed files with 79 additions and 19 deletions

View File

@@ -517,6 +517,24 @@ EOF
[[ "$output" == *"App saved states optimized"* ]]
}
@test "opt_cache_refresh continues on permission denied (silent exit)" {
local cache_dir="$HOME/Library/Caches/com.apple.QuickLook.thumbnailcache"
mkdir -p "$cache_dir"
touch "$cache_dir/test.db"
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" bash --noprofile --norc << 'EOF'
set -euo pipefail
source "$PROJECT_ROOT/lib/core/common.sh"
source "$PROJECT_ROOT/lib/optimize/tasks.sh"
qlmanage() { return 0; }
safe_remove() { return 1; }
opt_cache_refresh
EOF
[ "$status" -eq 0 ]
[[ "$output" == *"QuickLook thumbnails refreshed"* ]]
}
@test "opt_cache_refresh cleans Quick Look cache" {
mkdir -p "$HOME/Library/Caches/com.apple.QuickLook.thumbnailcache"
touch "$HOME/Library/Caches/com.apple.QuickLook.thumbnailcache/test.db"