This repository has been archived on 2024-08-13. You can view files and clone it, but cannot push or open issues or pull requests.
bunc/test/test-if.sh

27 lines
530 B
Bash
Raw Normal View History

#!/bin/bash
source "../lib/if.sh"
echo "_if_array_contains test started"
for result in 2 2 0 1; do
echo "Exit code should be ${result}"
eArray=(aa ab 0 dsa 2)
i=${result}
_if_array_contains "${i}" "${eArray[@]}"
echo $?
done
echo "_if_array_contains test ended"
echo "_if_is_integer test started"
for result in 0 1; do
echo "Exit code should be ${result}"
if [ ${result} == 0 ]; then
i=0
else
i=a
fi
_if_is_integer ${i}
echo $?
done
echo "_if_is_integer test ended"