

set -ex



pushd random_binaries
OUTPUT=$(binsort -q -t 1 . | tr "\n" " ")
echo Output is: ${OUTPUT}
if [[ ${OUTPUT} != "./0.txt ./1.txt ./2.txt ./3.txt ./4.txt " ]] && [[ ${OUTPUT} != "./4.txt ./3.txt ./2.txt ./1.txt ./0.txt " ]]; then
  echo "Expected: \"./0.txt ./1.txt ./2.txt ./3.txt ./4.txt or ./4.txt ./3.txt ./2.txt ./1.txt ./0.txt\" [FAIL]"
  echo "     Got: \"${OUTPUT}\" [FAIL]"
  exit 1
fi
exit 0
