X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=tests%2Flib.sh.test;h=3568c47de354f64e4dbfebd24fcf7ead4ee1ecb5;hb=3c9f2ee5ea8c7fe57864cad38f4f6188c569fa5d;hp=e8d5053be6ebec71118818ad1c3a7505b0787525;hpb=0d362b7f25680421a0b29f1ac940004304785921;p=config%2Fdotfiles.git diff --git a/tests/lib.sh.test b/tests/lib.sh.test index e8d5053..3568c47 100644 --- a/tests/lib.sh.test +++ b/tests/lib.sh.test @@ -41,6 +41,18 @@ echo stupid which installed ls && echo ls installed installed doesnt-exist && echo doesnt-exist installed +# which with proper exit codes and no output in case of an error. +which() { + if [ $1 = ls ]; then + echo /bin/ls + else + return 1 + fi +} +echo different which +installed ls && echo ls installed +installed doesnt-exist && echo doesnt-exist installed + # Tests for generate(). echo "Simple test file for generate() using m4.