Skip to content

Commit

Permalink
More assertive fail() examples for doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ceejatec committed Apr 25, 2024
1 parent 6e9d097 commit 204e931
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/assertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -866,10 +866,14 @@ when testing situations not covered by any `assert_*` functions.
::: code-group
```bash [Example]
function test_success() {
true || fail "This will never fail"
if false; then
fail "This will never fail"
fi
}
function test_failure() {
[ $(date +%-H) -lt 6 ] || fail "It's late, go to bed"
if true; then
fail "This will always fail"
fi
}
```
:::

0 comments on commit 204e931

Please sign in to comment.