From 381eee21ff5cb367d64fc50fa328a4302e3fe131 Mon Sep 17 00:00:00 2001 From: Alice Kaerast Date: Nov 09 2012 22:56:33 +0000 Subject: test a non-existant command --- 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 $?