X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=t%2Fapenwarr%2F260-whichdo%2Fnonexists.do;fp=t%2Fapenwarr%2F260-whichdo%2Fnonexists.do;h=9ca1cf5f9caf042af977ad308444b9ae5592af42;hb=150988618524bf17378bd8770231cda7c9bbb43a;hp=0000000000000000000000000000000000000000;hpb=f55840281e03ae8393c0a3a853807457865c2dc6;p=goredo.git diff --git a/t/apenwarr/260-whichdo/nonexists.do b/t/apenwarr/260-whichdo/nonexists.do new file mode 100644 index 0000000..9ca1cf5 --- /dev/null +++ b/t/apenwarr/260-whichdo/nonexists.do @@ -0,0 +1,45 @@ +exec >&2 + +# Testing the search path for non-existent do files is a little tricky. +# We can't be sure where our current directory is, so we don't know how +# far up the stack redo will need to search. +# +# To dodge the problem, let's "cd /" first so that we're testing a target +# relative to a known location (the root directory). + +if [ -e '/default.do' -o \ + -e '/default.z.do' -o \ + -e '/default.y.z.do' ]; then + echo "Weird: /default.*.do exists; can't run this test." + exit 99 +fi + +# redo-whichdo *should* fail here, so don't abort the script for that. +set +e +a=$(cd / && redo-whichdo __nonexist/a/x.y.z) +rv=$? +set -e + +if [ "$rv" -eq 0 ]; then + echo "redo-whichdo should return nonzero for a missing .do file." + exit 10 +fi + +b=$(cat <