Problem
$ bashunit doc no_such_assertion_xyz
$ echo $?
0
Nothing at all — indistinguishable from a broken install or missing embedded
docs. The same command already handles this on the other branch: --custom
with no matches prints No custom assertions found.
Matching is generous (substring), so near-misses still work — equal returns 9
assertions — and only a genuinely wrong term hits this. Low impact, but silence
is a poor answer to a lookup.
Fix
Say so, mirroring the --custom wording:
No assertion matches 'no_such_assertion_xyz'.
Run `bashunit doc` without a filter to list them all.
Exit code left at 0
doc is informational, not a verification command, and a script calling it
should not start failing. grep-style "exit 1 on no match" is defensible but is
a contract change, not a message fix.
Implementation note
The obvious approach — return non-zero from print_asserts — breaks
test_print_asserts_with_no_matching_filter, which captures its output under
--strict: set -e aborts at output=$(...) even though the assertion (no
output) still holds. Emptiness is decided in the caller instead, leaving that
function's contract alone.
Problem
Nothing at all — indistinguishable from a broken install or missing embedded
docs. The same command already handles this on the other branch:
--customwith no matches prints
No custom assertions found.Matching is generous (substring), so near-misses still work —
equalreturns 9assertions — and only a genuinely wrong term hits this. Low impact, but silence
is a poor answer to a lookup.
Fix
Say so, mirroring the
--customwording:Exit code left at 0
docis informational, not a verification command, and a script calling itshould not start failing. grep-style "exit 1 on no match" is defensible but is
a contract change, not a message fix.
Implementation note
The obvious approach — return non-zero from
print_asserts— breakstest_print_asserts_with_no_matching_filter, which captures its output under--strict:set -eaborts atoutput=$(...)even though the assertion (nooutput) still holds. Emptiness is decided in the caller instead, leaving that
function's contract alone.