Correct syntax & formatting in test_pratracker.sh

Use 4 spaces for indentations.
Use the same syntax for all functions.
No real code changes (except removal of unnecessary ";" from
"exit 1" command).
This commit is contained in:
skaluzka 2021-08-22 20:36:36 +02:00
parent 984e3a9c6c
commit bbbeed942f
No known key found for this signature in database
GPG Key ID: BA6384EF5EF76DF2

View File

@ -1,13 +1,13 @@
#!/bin/sh
# Fail if any subprocess fails unexpectedly
# Fail this script if any subprocess fails unexpectedly.
set -e
umask 077
unset TOR_DISABLE_PRACTRACKER
TMPDIR=""
clean () {
clean() {
if [ -n "$TMPDIR" ] && [ -d "$TMPDIR" ]; then
rm -rf "$TMPDIR"
fi
@ -27,7 +27,7 @@ PRACTRACKER_DIR="scripts/maint/practracker"
TMPDIR="$(mktemp -d -t pracktracker.test.XXXXXX)"
if test -z "${TMPDIR}" || test ! -d "${TMPDIR}" ; then
echo >&2 "mktemp failed."
exit 1;
exit 1
fi
DATA="${PRACTRACKER_DIR}/testdata"
@ -43,6 +43,7 @@ run_practracker() {
--terse \
"${DATA}/" "$@" || echo "practracker exit status: $?"
}
compare() {
# we can't use cmp because we need to use -b for windows
diff -b -u "$@" > "${TMPDIR}/test-diff" || true