Skip to content

Commit 63852df

Browse files
committed
test harness: Fix $skip_test support, broken yesterday.
It was broken by commit e6eea1f, "test harness: Don't leak options from test files to the test harness.".
1 parent 66021cf commit 63852df

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test-highlighting.zsh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,25 +124,26 @@ run_test_internal() {
124124
local -a expected_region_highlight region_highlight
125125

126126
local ARG="$1"
127+
local RETURN=""
127128
() {
128129
setopt localoptions
129130
. "$srcdir"/"$ARG"
130131

131132
# WARNING: The remainder of this anonymous function will run with the test's options in effect
132133

133-
(( $#skip_test )) && { print -r -- "1..0 # SKIP $skip_test"; return; }
134+
(( $#skip_test )) && { print -r -- "1..0 # SKIP $skip_test"; return ${RETURN:=0}; }
134135

135136
# Check the data declares $PREBUFFER or $BUFFER.
136-
[[ -z $PREBUFFER && -z $BUFFER ]] && { echo >&2 "Bail out! On ${(qq)1}: Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank"; return 1; }
137+
[[ -z $PREBUFFER && -z $BUFFER ]] && { echo >&2 "Bail out! On ${(qq)1}: Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank"; return ${RETURN:=1}; }
137138
# Check the data declares $expected_region_highlight.
138-
(( $+expected_region_highlight == 0 )) && { echo >&2 "Bail out! On ${(qq)1}: 'expected_region_highlight' is not declared."; return 1; }
139+
(( $+expected_region_highlight == 0 )) && { echo >&2 "Bail out! On ${(qq)1}: 'expected_region_highlight' is not declared."; return ${RETURN:=1}; }
139140

140141
# Set sane defaults for ZLE variables
141142
: ${CURSOR=$#BUFFER} ${PENDING=0} ${WIDGET=z-sy-h-test-harness-test-widget}
142143

143144
# Process the data.
144145
_zsh_highlight
145-
}
146+
}; [[ -z $RETURN ]] || return $RETURN
146147
unset ARG
147148

148149
if (( unsorted )); then

0 commit comments

Comments
 (0)