Skip to content

Commit f9c93a8

Browse files
committed
chore: check simple output in print_failed_test
1 parent 335c576 commit f9c93a8

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

src/console_results.sh

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,24 +139,33 @@ ${_COLOR_FAILED}✗ Failed${_COLOR_DEFAULT}: %s
139139
}
140140

141141
function console_results::print_failed_test() {
142-
local test_name=$1
143-
local expected=$2
144-
local failure_condition_message=$3
145-
local actual=$4
146-
local extra_key=$5
147-
local extra_value=$6
142+
if [[ "$SIMPLE_OUTPUT" == true ]]; then
143+
if (( _SUCCESSFUL_TEST_COUNT % 50 != 0 )); then
144+
printf "F"
145+
else
146+
printf "F\n"
147+
fi
148+
return
149+
fi
148150

149-
printf "\
150-
${_COLOR_FAILED}✗ Failed${_COLOR_DEFAULT}: %s
151-
${_COLOR_FAINT}Expected${_COLOR_DEFAULT} ${_COLOR_BOLD}'%s'${_COLOR_DEFAULT}
152-
${_COLOR_FAINT}%s${_COLOR_DEFAULT} ${_COLOR_BOLD}'%s'${_COLOR_DEFAULT}\n"\
153-
"${test_name}" "${expected}" "${failure_condition_message}" "${actual}"
151+
local test_name=$1
152+
local expected=$2
153+
local failure_condition_message=$3
154+
local actual=$4
155+
local extra_key=$5
156+
local extra_value=$6
154157

155-
if [ -n "$extra_key" ]; then
156158
printf "\
157-
${_COLOR_FAINT}%s${_COLOR_DEFAULT} ${_COLOR_BOLD}'%s'${_COLOR_DEFAULT}\n"\
158-
"${extra_key}" "${extra_value}"
159-
fi
159+
${_COLOR_FAILED}✗ Failed${_COLOR_DEFAULT}: %s
160+
${_COLOR_FAINT}Expected${_COLOR_DEFAULT} ${_COLOR_BOLD}'%s'${_COLOR_DEFAULT}
161+
${_COLOR_FAINT}%s${_COLOR_DEFAULT} ${_COLOR_BOLD}'%s'${_COLOR_DEFAULT}\n"\
162+
"${test_name}" "${expected}" "${failure_condition_message}" "${actual}"
163+
164+
if [ -n "$extra_key" ]; then
165+
printf "\
166+
${_COLOR_FAINT}%s${_COLOR_DEFAULT} ${_COLOR_BOLD}'%s'${_COLOR_DEFAULT}\n"\
167+
"${extra_key}" "${extra_value}"
168+
fi
160169
}
161170

162171
function console_results::print_failed_snapshot_test() {

0 commit comments

Comments
 (0)