3 # Testing the search path for non-existent do files is a little tricky.
4 # We can't be sure where our current directory is, so we don't know how
5 # far up the stack redo will need to search.
7 # To dodge the problem, let's "cd /" first so that we're testing a target
8 # relative to a known location (the root directory).
10 if [ -e '/default.do' -o \
11 -e '/default.z.do' -o \
12 -e '/default.y.z.do' ]; then
13 echo "Weird: /default.*.do exists; can't run this test."
17 # redo-whichdo *should* fail here, so don't abort the script for that.
19 a=$(cd / && redo-whichdo __nonexist/a/x.y.z)
23 if [ "$rv" -eq 0 ]; then
24 echo "redo-whichdo should return nonzero for a missing .do file."
30 __nonexist/a/default.y.z.do
31 __nonexist/a/default.z.do
32 __nonexist/a/default.do
33 __nonexist/default.y.z.do
34 __nonexist/default.z.do
42 if [ "$a" != "$b" ]; then
43 printf 'redo-whichdo mismatch.\n\ngot:\n%s\n\nexpected:\n%s\n' "$a" "$b"