Skip to content

Commit

Permalink
Fix Optimize coverage measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
ko1nksm committed May 27, 2020
1 parent 5f78da4 commit 97bbe9a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/evaluation.sh
Expand Up @@ -21,7 +21,7 @@ shellspec_evaluation_call() {
set "$SHELLSPEC_ERREXIT"
"${SHELLSPEC_SHELL_OPTION:-eval}" "${SHELLSPEC_SHELL_OPTIONS:-:}"
set +e
shellspec_evaluation_call_data shellspec_evaluation_call_function "$@"
shellspec_evaluation_call_data shellspec_evaluation_call_function "$@" &&:
set -e -- $?
shellspec_evaluation_cleanup "$1"
}
Expand Down
12 changes: 12 additions & 0 deletions spec/core/evaluation_spec.sh
Expand Up @@ -73,6 +73,12 @@ Describe "core/evaluation.sh"
The status should equal 0
End

It 'catches error when even enable errexit within function'
evaluation() { set -e; return 123; }
When call evaluation
The status should eq 123
End

It 'reads data from stdin'
Data "data"
When call cat
Expand Down Expand Up @@ -156,6 +162,12 @@ Describe "core/evaluation.sh"
The status should equal 0
End

It 'catches error when even enable errexit within function'
evaluation() { set -e; return 123; }
When run evaluation
The status should eq 123
End

It 'reads data from stdin'
Data "data"
When run command cat
Expand Down

0 comments on commit 97bbe9a

Please sign in to comment.