Skip to content

Commit bb0f3ed

Browse files
Test Userclaude
andcommitted
fix: use portable arithmetic syntax for bash 5.x
((VAR++)) returns exit code 1 when VAR=0 in newer bash versions, causing failures with set -e. Use VAR=$((VAR + 1)) instead. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c547bf7 commit bb0f3ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
git config --global user.name "Test User"
3232
3333
- name: Run tests
34-
run: bash -x tests/test_runner.sh
34+
run: bash tests/test_runner.sh

tests/test_runner.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ run_test() {
131131
local test_name="$1"
132132
local test_func="$2"
133133

134-
((TESTS_RUN++))
134+
TESTS_RUN=$((TESTS_RUN + 1))
135135

136136
# Setup fresh environment for each test
137137
setup_test_env
@@ -141,10 +141,10 @@ run_test() {
141141
# Run test in subshell to catch failures
142142
if (set -e; $test_func) 2>/dev/null; then
143143
echo "${GREEN}PASS${RESET}"
144-
((TESTS_PASSED++))
144+
TESTS_PASSED=$((TESTS_PASSED + 1))
145145
else
146146
echo "${RED}FAIL${RESET}"
147-
((TESTS_FAILED++))
147+
TESTS_FAILED=$((TESTS_FAILED + 1))
148148
fi
149149

150150
# Cleanup

0 commit comments

Comments
 (0)