| Q |
A |
| OS |
Linux (Cygwin on Windows) |
| Shell & version |
bash 5.2.21(1)-release |
| bashunit version |
0.34.1 |
Summary
assert_true and assert_false both give misleading output if the value given is empty because they continue past the case statement and attempt to eval an empty string
Current behavior
Expected 'command or function with zero exit code'
but got 'exit code: 127'
How to reproduce
empty_var=''
assert_true "$empty_var"
assert_false "$empty_var
Expected behavior
Expected 'true or 0'
Got ''
Summary
assert_trueandassert_falseboth give misleading output if the value given is empty because they continue past thecasestatement and attempt toevalan empty stringCurrent behavior
How to reproduce
Expected behavior