Skip to content

Commit

Permalink
feat: add whitespace to test summary status
Browse files Browse the repository at this point in the history
  • Loading branch information
h0adp0re committed Feb 27, 2024
1 parent 4fe733e commit 8af4aef
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 18 deletions.
12 changes: 6 additions & 6 deletions src/console_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,36 +65,36 @@ function console_results::render_result() {
printf " %s total\n" "$total_assertions"

if [[ "$(state::get_tests_failed)" -gt 0 ]]; then
printf "%s%s%s\n" "$_COLOR_RETURN_ERROR" "Some tests failed" "$_COLOR_DEFAULT"
printf "\n%s%s%s\n" "$_COLOR_RETURN_ERROR" " Some tests failed " "$_COLOR_DEFAULT"
console_results::print_execution_time
exit 1
fi

if [[ "$(state::get_tests_incomplete)" -gt 0 ]]; then
printf "%s%s%s\n" "$_COLOR_RETURN_INCOMPLETE" "Some tests incomplete" "$_COLOR_DEFAULT"
printf "\n%s%s%s\n" "$_COLOR_RETURN_INCOMPLETE" " Some tests incomplete " "$_COLOR_DEFAULT"
console_results::print_execution_time
exit 0
fi

if [[ "$(state::get_tests_skipped)" -gt 0 ]]; then
printf "%s%s%s\n" "$_COLOR_RETURN_SKIPPED" "Some tests skipped" "$_COLOR_DEFAULT"
printf "\n%s%s%s\n" "$_COLOR_RETURN_SKIPPED" " Some tests skipped " "$_COLOR_DEFAULT"
console_results::print_execution_time
exit 0
fi

if [[ "$(state::get_tests_snapshot)" -gt 0 ]]; then
printf "%s%s%s\n" "$_COLOR_RETURN_SNAPSHOT" "Some snapshots created" "$_COLOR_DEFAULT"
printf "\n%s%s%s\n" "$_COLOR_RETURN_SNAPSHOT" " Some snapshots created " "$_COLOR_DEFAULT"
console_results::print_execution_time
exit 0
fi

if [[ $total_tests -eq 0 ]]; then
printf "%s%s%s\n" "$_COLOR_RETURN_ERROR" "No tests found" "$_COLOR_DEFAULT"
printf "\n%s%s%s\n" "$_COLOR_RETURN_ERROR" " No tests found " "$_COLOR_DEFAULT"
console_results::print_execution_time
exit 1
fi

printf "%s%s%s\n" "$_COLOR_RETURN_SUCCESS" "All tests passed" "$_COLOR_DEFAULT"
printf "\n%s%s%s\n" "$_COLOR_RETURN_SUCCESS" " All tests passed " "$_COLOR_DEFAULT"
console_results::print_execution_time
exit 0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh

Tests:  4 passed, 1 failed, 5 total
Assertions: 6 passed, 1 failed, 7 total
Some tests failed

 Some tests failed 
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh

Tests:  4 passed, 1 failed, 5 total
Assertions: 6 passed, 1 failed, 7 total
Some tests failed

 Some tests failed 
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Running ./tests/acceptance/fixtures/tests_path/other_test.sh

Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
All tests passed

 All tests passed 
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Running ./tests/acceptance/fixtures/tests_path/other_test.sh

Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
All tests passed

 All tests passed 
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Running ./tests/acceptance/fixtures/tests_path/a_test.sh

Tests:  2 passed, 2 total
Assertions: 3 passed, 3 total
All tests passed

 All tests passed 
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
....
Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
All tests passed

 All tests passed 
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
....
Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
All tests passed

 All tests passed 
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_passes.sh

Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
All tests passed

 All tests passed 
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_passes.sh

Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
All tests passed

 All tests passed 
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

Tests:  0 total
Assertions: 0 total
No tests found

 No tests found 
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Running tests/acceptance/fixtures/tests_path/other_test.sh

Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
All tests passed

 All tests passed 
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Running tests/acceptance/fixtures/tests_path/other_test.sh

Tests:  4 passed, 4 total
Assertions: 6 passed, 6 total
All tests passed

 All tests passed 

0 comments on commit 8af4aef

Please sign in to comment.