mirror of
https://github.com/tw93/Mole.git
synced 2026-02-07 11:03:29 +00:00
feat: optimize clean operation performance by pre-expanding whitelist patterns, improving size calculation, and adapting parallel processing based on file types, alongside test suite enhancements.
This commit is contained in:
@@ -28,7 +28,7 @@ setup() {
|
||||
}
|
||||
|
||||
@test "mo clean --dry-run skips system cleanup in non-interactive mode" {
|
||||
run env HOME="$HOME" "$PROJECT_ROOT/mole" clean --dry-run
|
||||
run env HOME="$HOME" MOLE_TEST_MODE=1 "$PROJECT_ROOT/mole" clean --dry-run
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"Dry Run Mode"* ]]
|
||||
[[ "$output" != *"Deep system-level cleanup"* ]]
|
||||
@@ -38,7 +38,7 @@ setup() {
|
||||
mkdir -p "$HOME/Library/Caches/TestApp"
|
||||
echo "cache data" > "$HOME/Library/Caches/TestApp/cache.tmp"
|
||||
|
||||
run env HOME="$HOME" "$PROJECT_ROOT/mole" clean --dry-run
|
||||
run env HOME="$HOME" MOLE_TEST_MODE=1 "$PROJECT_ROOT/mole" clean --dry-run
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"User app cache"* ]]
|
||||
[[ "$output" == *"Potential space"* ]]
|
||||
@@ -53,7 +53,7 @@ setup() {
|
||||
$HOME/Library/Caches/WhitelistedApp*
|
||||
EOF
|
||||
|
||||
run env HOME="$HOME" "$PROJECT_ROOT/mole" clean --dry-run
|
||||
run env HOME="$HOME" MOLE_TEST_MODE=1 "$PROJECT_ROOT/mole" clean --dry-run
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"Protected"* ]]
|
||||
[ -f "$HOME/Library/Caches/WhitelistedApp/data.tmp" ]
|
||||
@@ -63,7 +63,7 @@ EOF
|
||||
mkdir -p "$HOME/.m2/repository/org/example"
|
||||
echo "dependency" > "$HOME/.m2/repository/org/example/lib.jar"
|
||||
|
||||
run env HOME="$HOME" "$PROJECT_ROOT/mole" clean --dry-run
|
||||
run env HOME="$HOME" MOLE_TEST_MODE=1 "$PROJECT_ROOT/mole" clean --dry-run
|
||||
[ "$status" -eq 0 ]
|
||||
[ -f "$HOME/.m2/repository/org/example/lib.jar" ]
|
||||
[[ "$output" != *"Maven repository cache"* ]]
|
||||
|
||||
@@ -27,7 +27,7 @@ setup() {
|
||||
}
|
||||
|
||||
@test "mo clean --debug creates debug log file" {
|
||||
run env HOME="$HOME" MO_DEBUG=1 "$PROJECT_ROOT/mole" clean --dry-run
|
||||
run env HOME="$HOME" MOLE_TEST_MODE=1 MO_DEBUG=1 "$PROJECT_ROOT/mole" clean --dry-run
|
||||
[ "$status" -eq 0 ]
|
||||
MOLE_OUTPUT="$output"
|
||||
|
||||
@@ -44,14 +44,14 @@ setup() {
|
||||
}
|
||||
|
||||
@test "mo clean without debug does not show debug log path" {
|
||||
run env HOME="$HOME" MO_DEBUG=0 "$PROJECT_ROOT/mole" clean --dry-run
|
||||
run env HOME="$HOME" MOLE_TEST_MODE=1 MO_DEBUG=0 "$PROJECT_ROOT/mole" clean --dry-run
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
[[ "$output" != *"Debug session log saved to"* ]]
|
||||
}
|
||||
|
||||
@test "mo clean --debug logs system info" {
|
||||
run env HOME="$HOME" MO_DEBUG=1 "$PROJECT_ROOT/mole" clean --dry-run
|
||||
run env HOME="$HOME" MOLE_TEST_MODE=1 MO_DEBUG=1 "$PROJECT_ROOT/mole" clean --dry-run
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
DEBUG_LOG="$HOME/.config/mole/mole_debug_session.log"
|
||||
|
||||
Reference in New Issue
Block a user