Преглед на файлове

tests: Allow marking the cardinality check as TODO (XFail).

Needed for next commit.
pull/599/head
Daniel Shahaf преди 5 години
родител
ревизия
864864442e
променени са 2 файла, в които са добавени 7 реда и са изтрити 1 реда
  1. +5
    -0
      tests/README.md
  2. +2
    -1
      tests/test-highlighting.zsh

+ 5
- 0
tests/README.md Целия файл

@ -21,6 +21,11 @@ with the provided string as the reason.
If a test sets `unsorted=1` the order of highlights in `$expected_region_highlight`
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.
**Note**: `$region_highlight` uses the same `"$i $j $style"` syntax but
interprets the indexes differently.

+ 2
- 1
tests/test-highlighting.zsh Целия файл

@ -98,6 +98,7 @@ run_test_internal() {
# Load the data and prepare checking it.
local BUFFER CURSOR MARK PENDING PREBUFFER REGION_ACTIVE WIDGET skip_test unsorted=0
local expected_mismatch
local -a expected_region_highlight region_highlight
. "$srcdir"/"$1"
@ -154,7 +155,7 @@ run_test_internal() {
if (( $#expected_region_highlight == $#region_highlight )); then
print -r -- "ok $i - cardinality check"
else
print -r -- "not ok $i - have $#expected_region_highlight expectations and $#region_highlight region_highlight entries"
print -r -- "not ok $i - have $#expected_region_highlight expectations and $#region_highlight region_highlight entries: «$(typeset -p expected_region_highlight)» «$(typeset -p region_highlight)»" "${expected_mismatch:+" # TODO : $expected_mismatch"}"
fi
}

Зареждане…
Отказ
Запис