summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxxc3nsoredxx <xxc3ncoredxx@gmail.com>2021-05-11 00:33:42 -0500
committerRasmus Thomsen <oss@cogitri.dev>2021-06-01 14:25:32 +0200
commit5ff41ab1cb96021b7e3d6315007beeab6c6e4f8f (patch)
tree819a98c202c3e130fa5bf69be267681f86a29217
parent4cba11b9b54ecac0a7641c13ab960ab72bb0aca9 (diff)
downloadwgetpaste-5ff41ab1cb96021b7e3d6315007beeab6c6e4f8f.tar.gz
Improve hard skip format
Convert from array to map, service -> reason. Printing the reason as part of the hard skip message makes the output self-documenting.
-rwxr-xr-xtest/test.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test.sh b/test/test.sh
index 536bc05..5652baa 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -9,8 +9,10 @@ TEST_DIR="$(dirname "$0")"
TEST_FILE="$TEST_DIR/test.txt"
DL_DIR="$(mktemp -q -d /tmp/wgetpaste_test.XXXXX)"
# Services to hard skip
-# codepad: timing out
-HARD_SKIPS=('codepad')
+# Pre-declare as map to maintain type even if empty
+# key -> value := service -> reason
+declare -A HARD_SKIPS
+HARD_SKIPS=(['codepad']='always times out')
HARD_SKIP_COUNT=0
# Services expected to require an authorization token
AUTH_SKIPS=('gists' 'snippets')
@@ -30,9 +32,9 @@ echo "Using download directory: $DL_DIR"
# Download the resulting paste into /tmp/wgetpaste_test.XXXXX/<service>.txt
for serv in $("$TEST_DIR"/../wgetpaste -S --completions); do
# Hard skips
- for hs in "${HARD_SKIPS[@]}"; do
+ for hs in "${!HARD_SKIPS[@]}"; do
if [ "$serv" == "$hs" ]; then
- echo "HARD SKIP on $serv..."
+ echo "HARD SKIP on $serv -- reason: ${HARD_SKIPS[$serv]}"
HARD_SKIP_COUNT=$((HARD_SKIP_COUNT + 1))
continue 2
fi