sourcing a file with set -e
causes the tests to always succeed
#390
Labels
bug
Something isn't working
set -e
causes the tests to always succeed
#390
Summary
If I use
set -e
in my script andsource
it to test the behavior of a function, the test always succeed. Even when it clearly should fail.NOTE: this only happens when I
source
the script.IMO this is a serious bug that puts into question the reliability of bashunit, as it reports a failing test as successful (it would be slightly less serious if it were the other way around).
How to reproduce
Here's my
hello.sh
script:Here's the
hello_test.sh
(note that both are supposed to fail,X != "Hello, World!"
):When I run this test I have this:
Again: if I remove the
set -e
inhello.sh
this buggy success does NOT happen..Expected behavior
Do not report a failing test behavior as success, even if the script has
set -e
and issource
d.The text was updated successfully, but these errors were encountered: