Skip to content

Commit

Permalink
extraDiffArgs can't be empty for masOS's really old Bash
Browse files Browse the repository at this point in the history
  • Loading branch information
pcolby committed Feb 11, 2024
1 parent ac09c9b commit ac6582c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ while IFS= read -d '' -r dirName; do
while IFS='' read -r file; do tapFiles+=("${file}"); done < <(find "${dirName}" -name '*.tap' -type f -d -print || :)
gawk -f "${SOURCE_DIR}/../summary.gawk" --sandbox -- "${tapFiles[@]}" >| "${dirName}/observed.md"
case "${OSTYPE}" in
darwin*) extraDiffArgs=() ;; # macOS
msys*) extraDiffArgs=(--color=auto --strip-trailing-cr) ;; # Windows
*) extraDiffArgs=(--color=auto) ;;
darwin*) diffOptions=(--unified) ;; # macOS
msys*) diffOptions=(--color=auto --strip-trailing-cr --unified) ;; # Windows
*) diffOptions=(--color=auto --unified) ;;
esac
diff "${extraDiffArgs[@]}" --unified "${dirName}/expected.md" "${dirName}/observed.md" || ((++failures))
diff "${diffOptions[@]}" "${dirName}/expected.md" "${dirName}/observed.md" || ((++failures))
done < <(find "${SOURCE_DIR}" -maxdepth 1 -mindepth 1 -type d -print0 || :)
[[ "${failures}" -eq 0 ]]

0 comments on commit ac6582c

Please sign in to comment.