New options to only run assert or competion tests
New tests for missing permissions
This commit is contained in:
@@ -27,6 +27,8 @@ readonly color_less='\033[0m'
|
||||
flag_runall=0
|
||||
flag_extendedOutput=0
|
||||
flag_verbose=0
|
||||
flag_onlyassert=0
|
||||
flag_onlycompete=0
|
||||
|
||||
toassert=()
|
||||
tocompete=()
|
||||
@@ -102,9 +104,18 @@ rl::test() {
|
||||
flag_extendedOutput=1
|
||||
flag_verbose=1
|
||||
shift ;;
|
||||
-oa|--only-assert)
|
||||
flag_onlyassert=1
|
||||
shift ;;
|
||||
-oc|--only-compete)
|
||||
flag_onlycompete=1
|
||||
shift ;;
|
||||
esac
|
||||
done
|
||||
|
||||
(( flag_onlyassert )) && tocompete=()
|
||||
(( flag_onlycompete )) && toassert=()
|
||||
|
||||
# Only run `compete_args` if arguments are available
|
||||
if [[ "$@" ]]; then
|
||||
compete_args=( "Tests from command line" "$@" )
|
||||
@@ -113,7 +124,7 @@ rl::test() {
|
||||
fi
|
||||
|
||||
# Compare against expected result
|
||||
printf "\n# Assertion tests (\"Expected path\" == rdlink)\n"
|
||||
(( ${#toassert[@]} )) && printf "\n# Assertion tests (\"Expected path\" == rdlink)\n"
|
||||
for testarray in "${toassert[@]}"; do
|
||||
i=0
|
||||
arraywalker="$testarray"[@]
|
||||
@@ -143,7 +154,7 @@ rl::test() {
|
||||
done
|
||||
|
||||
# Compare output of rdlink and readlink -f
|
||||
printf "\n# Competition tests (readlink -f == rdlink)\n"
|
||||
(( ${#tocompete[@]} )) && printf "\n# Competition tests (readlink -f == rdlink)\n"
|
||||
for testarray in "${tocompete[@]}"; do
|
||||
i=0
|
||||
arraywalker="$testarray"[@]
|
||||
|
Reference in New Issue
Block a user