diff --git a/tests/p_which/which_fail.sh b/tests/p_which/which_fail.sh new file mode 100755 index 0000000..a3420b6 --- /dev/null +++ b/tests/p_which/which_fail.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author: Alice Kaerast + +t_Log "Running $0 - Checking which can fails on non-existing commands" +which abc123 2> /dev/null +[ $? -eq 1 ] || { t_Log "Which should have exited with 1 for a non-existing file"; exit $FAIL; } +t_CheckExitStatus $?