mirror of
https://github.com/tw93/Mole.git
synced 2026-03-22 21:55:08 +00:00
fix: preserve interrupt semantics and restore purge traps
This commit is contained in:
@@ -110,6 +110,19 @@ teardown() {
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "safe_remove preserves interrupt exit codes" {
|
||||
local test_file="$TEST_DIR/interrupt_file"
|
||||
echo "test" > "$test_file"
|
||||
|
||||
run bash -c "
|
||||
source '$PROJECT_ROOT/lib/core/common.sh'
|
||||
rm() { return 130; }
|
||||
safe_remove '$test_file' true
|
||||
"
|
||||
[ "$status" -eq 130 ]
|
||||
[ -f "$test_file" ]
|
||||
}
|
||||
|
||||
@test "safe_remove in silent mode suppresses error output" {
|
||||
run bash -c "source '$PROJECT_ROOT/lib/core/common.sh'; safe_remove '/System/test' true 2>&1"
|
||||
[ "$status" -eq 1 ]
|
||||
|
||||
Reference in New Issue
Block a user