@@ -120,6 +120,7 @@ run_test_internal() {
120
120
# Load the data and prepare checking it.
121
121
local BUFFER CURSOR MARK PENDING PREBUFFER REGION_ACTIVE WIDGET REPLY skip_test unsorted=0
122
122
local expected_mismatch
123
+ local skip_mismatch
123
124
local -a expected_region_highlight region_highlight
124
125
125
126
. " $srcdir " /" $1 "
@@ -155,11 +156,11 @@ run_test_internal() {
155
156
local todo=
156
157
if (( $+ expected_highlight_zone[4 ] )) ; then
157
158
todo=" # TODO $expected_highlight_zone [4]"
158
- : ${expected_mismatch : =" cardinality check disabled whilst regular test points are expected to fail" }
159
+ skip_mismatch =" cardinality check disabled whilst regular test points are expected to fail"
159
160
fi
160
161
if ! (( $+ region_highlight[i] )) ; then
161
162
print -r -- " not ok $i - unmatched expectation ($exp_start $exp_end $expected_highlight_zone [3])" \
162
- " ${expected_mismatch : +" # TODO ${(qqq)expected_mismatch } " } "
163
+ " ${skip_mismatch : +" # TODO ${(qqq)skip_mismatch } " } "
163
164
continue
164
165
fi
165
166
local -a highlight_zone; highlight_zone=( ${(z)region_highlight[i]} )
@@ -183,18 +184,27 @@ run_test_internal() {
183
184
unset desc
184
185
done
185
186
186
- if [[ -n $expected_mismatch ]]; then
187
- tap_escape $expected_mismatch ; expected_mismatch=$REPLY
188
- print " ok $i - cardinality check" " # SKIP $expected_mismatch "
187
+ # If both $skip_mismatch and $expected_mismatch are set, that means the test
188
+ # has some XFail test points, _and_ explicitly sets $expected_mismatch as
189
+ # well. Explicit settings should have priority, so we ignore $skip_mismatch
190
+ # if $expected_mismatch is set.
191
+ if [[ -n $skip_mismatch && -z $expected_mismatch ]]; then
192
+ tap_escape $skip_mismatch ; skip_mismatch=$REPLY
193
+ print " ok $i - cardinality check" " # SKIP $skip_mismatch "
189
194
else
195
+ local todo
196
+ if [[ -n $expected_mismatch ]]; then
197
+ tap_escape $expected_mismatch ; expected_mismatch=$REPLY
198
+ todo=" # TODO $expected_mismatch "
199
+ fi
190
200
if (( $# expected_region_highlight == $# region_highlight )) ; then
191
- print -r -- " ok $i - cardinality check"
201
+ print -r -- " ok $i - cardinality check${todo : + - } $todo "
192
202
else
193
203
local details
194
204
details+=" have $# expected_region_highlight expectations and $# region_highlight region_highlight entries: "
195
205
details+=" «$( typeset_p expected_region_highlight) » «$( typeset_p region_highlight) »"
196
206
tap_escape $details ; details=$REPLY
197
- print -r -- " not ok $i - cardinality check - $details "
207
+ print -r -- " not ok $i - cardinality check - $details ${todo : + - } $todo "
198
208
fi
199
209
fi
200
210
}
0 commit comments