aboutsummaryrefslogtreecommitdiff
path: root/scripts/full-test.sh
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-20 06:54:47 -0600
committerCraig Jennings <c@cjennings.net>2026-01-20 06:54:47 -0600
commitcb9d9824d994d5e11fc70bce7f83be2343912369 (patch)
tree53c0240ec5eb82738afff149e57d5097c4667eb3 /scripts/full-test.sh
parent9c201f119d47f0349d6fc27da88576e9306309d8 (diff)
downloadarchangel-cb9d9824d994d5e11fc70bce7f83be2343912369.tar.gz
archangel-cb9d9824d994d5e11fc70bce7f83be2343912369.zip
Fix full-test.sh exiting after first passed test
Bug: ((TESTS_PASSED++)) returns exit code 1 when TESTS_PASSED is 0, because post-increment evaluates the old value (0) which is falsy. With set -e, this caused the script to exit after the first test passed. Fix: Use pre-increment ((++TESTS_PASSED)) which returns the new value.
Diffstat (limited to 'scripts/full-test.sh')
-rwxr-xr-xscripts/full-test.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/full-test.sh b/scripts/full-test.sh
index 085e248..811dfa6 100755
--- a/scripts/full-test.sh
+++ b/scripts/full-test.sh
@@ -71,7 +71,7 @@ FAILED_TESTS=()
info() { echo -e "${GREEN}[INFO]${NC} $1"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
error() { echo -e "${RED}[ERROR]${NC} $1"; }
-pass() { echo -e "${GREEN}[PASS]${NC} $1"; ((TESTS_PASSED++)); }
+pass() { echo -e "${GREEN}[PASS]${NC} $1"; ((++TESTS_PASSED)); }
fail() { echo -e "${RED}[FAIL]${NC} $1"; ((TESTS_FAILED++)); FAILED_TESTS+=("$1"); }
banner() {