tests: passing in environments without sudo

This commit is contained in:
iff 2025-04-06 16:45:12 +02:00
parent d339923354
commit d81ee69611
3 changed files with 14 additions and 4 deletions

View file

@ -2,3 +2,5 @@ case="privilege"
command="pacman -Syu"
error="you cannot perform this operation unless you are root"
expect="sudo pacman -Syu"
export _PR_EXECUTABLES="sudo doas"

6
tests/main.sh Normal file → Executable file
View file

@ -28,8 +28,10 @@ run_test() {
}
run_case() {
source $1
run_test "$case" "$command" "$error" "$expect"
(
source $1
run_test "$case" "$command" "$error" "$expect"
)
if [[ $? == 0 ]]; then
PASSED=$((PASSED + 1))