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

Automated test synchronous update

This commit is contained in:
Tw93
2025-11-29 23:14:46 +09:00
parent a184094f45
commit 3f9d1205fd
10 changed files with 20 additions and 175 deletions

View File

@@ -148,29 +148,6 @@ EOF
rm -f "$HOME/temp_file_path.txt" "$HOME/temp_dir_path.txt"
}
@test "parallel_execute runs worker across all items" {
output_file="$HOME/parallel_output.txt"
HOME="$HOME" bash --noprofile --norc << 'EOF'
source "$PROJECT_ROOT/lib/common.sh"
worker() {
echo "$1" >> "$HOME/parallel_output.txt"
}
parallel_execute 2 worker "first" "second" "third"
EOF
sort "$output_file" > "$output_file.sorted"
results=()
while IFS= read -r line; do
results+=("$line")
done < "$output_file.sorted"
[ "${#results[@]}" -eq 3 ]
joined=" ${results[*]} "
[[ "$joined" == *" first "* ]]
[[ "$joined" == *" second "* ]]
[[ "$joined" == *" third "* ]]
rm -f "$output_file" "$output_file.sorted"
}
@test "should_protect_data protects system and critical apps" {
# System apps should be protected