diff --git a/tests/README.md b/tests/README.md index 89aef14..a413e16 100644 --- a/tests/README.md +++ b/tests/README.md @@ -23,8 +23,7 @@ need not match the order in `$region_highlight`. Normally, tests fail if `$expected_region_highlight` and `$region_highlight` have different numbers of elements. Tests may set `$expected_mismatch` to an -explanation string (like `$todo`) to avoid this and mark the cardinality check -as todo. +explanation string (like `$todo`) to avoid this and skip the cardinality check. **Note**: `$region_highlight` uses the same `"$i $j $style"` syntax but interprets the indexes differently. diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index b55324c..7b32dbc 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -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 }