mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
tests: Make $expected_mismatch skip the cardinality check, rather
than consider it an expected failure. With this change, if $expected_region_highlight and $region_highlight coincidentally have the same number of elements, the test won't be considered to fail. This is useful in conjunction with the next commit, q.v.. At this time, no tests set $expected_mismatch explicitly. However, the commit after next (this commit's grandchild) will add a test that will set $expected_mismatch implicitly, using the functionality in the next commit (this commit's child).
This commit is contained in:
parent
e209cbe61a
commit
d5a4a6e195
2 changed files with 7 additions and 5 deletions
|
|
@ -171,14 +171,17 @@ run_test_internal() {
|
|||
unset desc
|
||||
done
|
||||
|
||||
if (( $#expected_region_highlight == $#region_highlight )); then
|
||||
print -r -- "ok $i - cardinality check" "${expected_mismatch:+"# TODO ${(qqq)expected_mismatch}"}"
|
||||
if [[ -n $expected_mismatch ]]; then
|
||||
tap_escape $expected_mismatch; expected_mismatch=$REPLY
|
||||
print "ok $i - cardinality check" "# SKIP $expected_mismatch"
|
||||
elif (( $#expected_region_highlight == $#region_highlight )); then
|
||||
print -r -- "ok $i - cardinality check"
|
||||
else
|
||||
local details
|
||||
details+="have $#expected_region_highlight expectations and $#region_highlight region_highlight entries: "
|
||||
details+="«$(typeset_p expected_region_highlight)» «$(typeset_p region_highlight)»"
|
||||
tap_escape $details; details=$REPLY
|
||||
print -r -- "not ok $i - cardinality check" "$details" "${expected_mismatch:+"# TODO ${(qqq)expected_mismatch}"}"
|
||||
print -r -- "not ok $i - cardinality check - $details"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue