1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 20:15:07 +00:00

fix: dedupe cleanup previews by filesystem identity

This commit is contained in:
Tw93
2026-03-19 00:32:28 +08:00
parent 03db800709
commit 821a824d81
5 changed files with 106 additions and 2 deletions

View File

@@ -125,6 +125,18 @@ PLIST
[ -f "$HOME/Library/LaunchAgents/com.example.stale.plist" ]
}
@test "mo clean --dry-run does not export duplicate targets across sections" {
mkdir -p "$HOME/Library/Application Support/Code/CachedData"
echo "cache" > "$HOME/Library/Application Support/Code/CachedData/data.bin"
run env HOME="$HOME" MOLE_TEST_MODE=0 "$PROJECT_ROOT/mole" clean --dry-run
[ "$status" -eq 0 ]
run grep -c "Application Support/Code/CachedData" "$HOME/.config/mole/clean-list.txt"
[ "$status" -eq 0 ]
[ "$output" -eq 1 ]
}
@test "mo clean honors whitelist entries" {
mkdir -p "$HOME/Library/Caches/WhitelistedApp"
echo "keep me" > "$HOME/Library/Caches/WhitelistedApp/data.tmp"