Skip to content

Commit 78cb2c3

Browse files
committed
docs(test-files): document syntax-error handling
1 parent ebbaef9 commit 78cb2c3

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

docs/test-files.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,23 @@ function tear_down_after_script() {
129129
}
130130
```
131131
:::
132+
133+
## Syntax errors in test files
134+
135+
If a test file contains a Bash syntax error, **bashunit** records a failing
136+
test for that file instead of silently skipping the remaining tests. The exact
137+
error message from Bash (including file path and line number) is shown in the
138+
summary, and the suite exits with a non-zero status.
139+
140+
```
141+
Running tests/example_test.sh
142+
✗ Error: Source
143+
tests/example_test.sh: line 10: syntax error near unexpected token `fi'
144+
tests/example_test.sh: line 10: ` fi'
145+
146+
Tests: 1 failed, 1 total
147+
Some tests failed
148+
```
149+
150+
This guarantees a broken test file always fails the suite — it never passes
151+
by absence.

0 commit comments

Comments
 (0)