X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=t%2Fredo-sh.tests%2Fwhichdo_absolute_default_2%2Ftest;fp=t%2Fredo-sh.tests%2Fwhichdo_absolute_default_2%2Ftest;h=9b4024fb5854c4b4583f2cc8b6e6edb5e98a8191;hb=a6510ac6225a3a93df9d27dc316a3c1c0fcde426;hp=0000000000000000000000000000000000000000;hpb=a5111e179e5aca57420fd1cc95c1b21e7cd34226;p=goredo.git diff --git a/t/redo-sh.tests/whichdo_absolute_default_2/test b/t/redo-sh.tests/whichdo_absolute_default_2/test new file mode 100755 index 0000000..9b4024f --- /dev/null +++ b/t/redo-sh.tests/whichdo_absolute_default_2/test @@ -0,0 +1,21 @@ +#!/bin/sh -eu +# When invoked with an absolute filename for the file “default.do” as +# an argument, redo-whichdo must not output that filename as possible +# dofile. + +default_dofile="${PWD}/default.do" + +whichdo_dofiles=$( + redo-whichdo "${default_dofile}" \ + |tr '\0' '\n' +) + +for whichdo_dofile in ${whichdo_dofiles}; do + case "${whichdo_dofile}" in + "${default_dofile}") + >&2 printf 'redo-whichdo outputs that this file is its own dofile: %s\n' \ + "${whichdo_dofile}" + exit 1 + ;; + esac +done