Add a test for --shuffle option.
This commit is contained in:
parent
34ce233f5e
commit
9f6447e2cb
4 changed files with 22 additions and 0 deletions
1
t/140-shuffle/.gitignore
vendored
Normal file
1
t/140-shuffle/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
*.log
|
||||||
19
t/140-shuffle/all.do
Normal file
19
t/140-shuffle/all.do
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
exec >&2
|
||||||
|
. ../skip-if-minimal-do.sh
|
||||||
|
|
||||||
|
# Need to repeat this several times, on the off chance that shuffling the
|
||||||
|
# input happens to give us the same output (probability 1/factorial(9))
|
||||||
|
x=0
|
||||||
|
while [ "$x" -lt 10 ]; do
|
||||||
|
x=$(($x + 1))
|
||||||
|
rm -f out.log
|
||||||
|
redo --shuffle 1.x 2.x 3.x 4.x 5.x 6.x 7.x 8.x 9.x
|
||||||
|
sort out.log >sort.log
|
||||||
|
if ! diff -q out.log sort.log >/dev/null; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "retry: #$x"
|
||||||
|
done
|
||||||
|
|
||||||
|
# still not shuffled?
|
||||||
|
exit 22
|
||||||
1
t/140-shuffle/clean.do
Normal file
1
t/140-shuffle/clean.do
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
rm -f *.log *~ .*~
|
||||||
1
t/140-shuffle/default.x.do
Normal file
1
t/140-shuffle/default.x.do
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
echo $1 >>out.log
|
||||||
Loading…
Add table
Add a link
Reference in a new issue