Skip to content

Commit

Permalink
Use an array for extraDiffArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
pcolby committed Feb 11, 2024
1 parent 7669a4b commit ac09c9b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +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*) extraDiffArgs=() ;; # macOS
msys*) extraDiffArgs=(--color=auto --strip-trailing-cr) ;; # Windows
*) extraDiffArgs=(--color=auto) ;;
esac
# shellcheck disable=SC2086 # We intentionally want word splitting for $extraDiffArgs.
diff ${extraDiffArgs} --unified "${dirName}/expected.md" "${dirName}/observed.md" || ((++failures))
diff "${extraDiffArgs[@]}" --unified "${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 ac09c9b

Please sign in to comment.