Skip to content

Commit

Permalink
fix: echo does not break test execution result
Browse files Browse the repository at this point in the history
  • Loading branch information
cmayo committed Jun 27, 2024
1 parent b4013a8 commit 6b2e101
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function runner::run_test() {
local runtime_error
runtime_error=$(\
echo "$test_execution_result" |\
head -n 1 |\
tail -n 1 |\
sed -E -e 's/(.*)##ASSERTIONS_FAILED=.*/\1/g'\
)

Expand Down
7 changes: 7 additions & 0 deletions tests/unit/redirect_error_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ function test_redirect_error_without_log() {
assert_general_error
}

function test_echo_does_not_break_test_execution_result() {
printf "some text\nsome text"

_="$(render_into_error_fd_and_exit "...args")"
assert_exit_code 1
}

function render_into_error_fd_and_exit() {
echo "$*" >&2
exit 1
Expand Down

0 comments on commit 6b2e101

Please sign in to comment.