chore: improve tests/lean/copy-produced (#3006)

* do not take an argument, no longer needed
* make it whitespace-in-filenames safe
* copy verbosely when there are changes, for better user feedback
This commit is contained in:
Joachim Breitner 2023-12-01 15:34:52 +01:00 committed by GitHub
parent bd89787a87
commit 8be3897a8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,11 @@
#!/usr/bin/env bash
root="$(realpath $(dirname $0))"
cd ${1:-$PWD}
for f in $(find . -name '*.expected.out'); do
cp ${f/.expected/.produced} "$root/$f"
#
# Updates all *.expected.out files it finds within tests/lean
#
find "$(dirname "$0")" -name '*.expected.out' |
while read -r to; do
from="${to/.expected.out/.produced.out}"
cmp -s "$from" "$to" || cp -v "$from" "$to"
done