diff options
author | xxc3nsoredxx <xxc3ncoredxx@gmail.com> | 2021-05-11 00:33:42 -0500 |
---|---|---|
committer | Rasmus Thomsen <oss@cogitri.dev> | 2021-06-01 14:25:32 +0200 |
commit | 5ff41ab1cb96021b7e3d6315007beeab6c6e4f8f (patch) | |
tree | 819a98c202c3e130fa5bf69be267681f86a29217 | |
parent | 4cba11b9b54ecac0a7641c13ab960ab72bb0aca9 (diff) | |
download | wgetpaste-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-x | test/test.sh | 10 |
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 |