1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 23:40:09 +00:00

Fix cleanup regressions and analyze navigation

Refs #605 #607 #608 #609 #610
This commit is contained in:
Tw93
2026-03-21 13:04:48 +08:00
parent d51e1a621d
commit d6b9d9f3f3
13 changed files with 692 additions and 199 deletions

View File

@@ -237,6 +237,34 @@ EOF
[ "$status" -eq 0 ]
}
@test "mo clean --help includes external volume option" {
run env HOME="$HOME" "$PROJECT_ROOT/mole" clean --help
[ "$status" -eq 0 ]
[[ "$output" == *"--external PATH"* ]]
}
@test "mo clean --external accepts canonicalized custom root" {
real_root="$(mktemp -d "$HOME/ext-real.XXXXXX")"
link_root="$HOME/ext-link"
ln -s "$real_root" "$link_root"
mkdir -p "$link_root/USB/.Trashes"
touch "$link_root/USB/.Trashes/cache.tmp"
mock_bin="$HOME/mock-bin"
mkdir -p "$mock_bin"
cat > "$mock_bin/diskutil" <<'EOF'
#!/usr/bin/env bash
exit 0
EOF
chmod +x "$mock_bin/diskutil"
run env HOME="$HOME" PATH="$mock_bin:$PATH" MOLE_EXTERNAL_VOLUMES_ROOT="$link_root" \
MOLE_TEST_NO_AUTH=1 "$PROJECT_ROOT/mole" clean --external "$link_root/USB" --dry-run
[ "$status" -eq 0 ]
[[ "$output" == *"Clean External Volume"* ]]
[[ "$output" == *"External volume cleanup"* ]]
}
@test "touchid status reflects pam file contents" {
pam_file="$HOME/pam_test"
cat >"$pam_file" <<'EOF'