Skip to content

Commit 327ea9f

Browse files
committed
Update package_manager_exists.sh
1 parent 93ce791 commit 327ea9f

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.scripts/package_manager_exists.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,24 @@ package_manager_exists() {
1313
}
1414

1515
test_package_manager_exists() {
16-
warn "CI does not test package_manager_exists."
16+
local ForcePass='' # Force the tests to pass even on failure if set to a non-empty value
17+
local -i result=0
18+
local -a Test=(
19+
apt YES
20+
Apt YES
21+
nala NO
22+
Nala NO
23+
brew NO
24+
xxx NO
25+
)
26+
run_unit_tests_pipe "App" "App" "${ForcePass}" < <(
27+
for ((i = 0; i < ${#Test[@]}; i += 2)); do
28+
printf '%s\n' \
29+
"${Test[i]}" \
30+
"${Test[i + 1]}" \
31+
"$(run_script 'package_manager_is_installed' "${Test[i]}" && echo "YES" || echo "NO")"
32+
done
33+
)
34+
result=$?
35+
return ${result}
1736
}

0 commit comments

Comments
 (0)