Skip to content

Commit 74bdc63

Browse files
authored
Merge pull request #270 from TypedDevs/fix/exit-code-fn-call-non-exists
Fix: exit code when fn does not exist
2 parents 8763880 + 6a2b046 commit 74bdc63

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function main::exec_assert() {
2020
assert_fn="assert_$assert_fn"
2121
if ! type "$assert_fn" > /dev/null 2>&1; then
2222
echo "Function $original_assert_fn does not exist."
23-
exit 1
23+
exit 127
2424
fi
2525
fi
2626

tests/acceptance/bashunit_direct_fn_call_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ function test_bashunit_direct_fn_call_failure() {
7979

8080
function test_bashunit_direct_fn_call_non_existing_fn() {
8181
assert_match_snapshot "$(./bashunit -a non_existing_fn --env "$TEST_ENV_FILE")"
82-
assert_general_error "$(./bashunit -a non_existing_fn --env "$TEST_ENV_FILE")"
82+
assert_command_not_found "$(./bashunit -a non_existing_fn --env "$TEST_ENV_FILE")"
8383
}

0 commit comments

Comments
 (0)