]> Cypherpunks.ru repositories - goredo.git/blob - t/redo-sh.tests/whichdo_absolute_default_1/test
Import tests from apenwarr/redo and redo.sh
[goredo.git] / t / redo-sh.tests / whichdo_absolute_default_1 / test
1 #!/bin/sh -eu
2 # When invoked with an absolute path name with the prefix “default” as
3 # an argument, redo-whichdo must not output any dofile filename twice.
4
5 default_files="default default.a default.a.b default.do default.a.do default.a.b.do"
6
7 for default_file in ${default_files}; do
8  whichdo_dofiles_duplicates=$(
9   redo-whichdo "${PWD}/${default_file}" \
10    |tr '\0' '\n' \
11    |sort \
12    |uniq -d
13  )
14  case "${whichdo_dofiles_duplicates}" in
15   '')
16    ;;
17   *)
18    >&2 printf 'redo-whichdo duplicate output: %s \n' ${whichdo_dofiles_duplicates}
19    exit 1
20   ;;
21  esac
22 done