diff --git a/tests/tap-filter b/tests/tap-filter index feb22d2..f9aa604 100755 --- a/tests/tap-filter +++ b/tests/tap-filter @@ -41,5 +41,7 @@ use strict; undef $/; # slurp mode print for grep { /^ok.*# TODO/m or /^not ok(?!.*# TODO)/m or /^Bail out!/m } - split /^(?=#)/m, + # Split on plan lines and remove them from the output. (To keep them, + # use the lookahead syntax, «(?=…)», to make the match zero-length.) + split /^\d+\.\.\d+$/m, ; diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index 1115712..465abe0 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -117,10 +117,6 @@ run_test_internal() { local srcdir="$PWD" builtin cd -q -- "$tests_tempdir" || { echo >&2 "Bail out! On ${(qq)1}: cd failed: $?"; return 1 } - echo "# ${1:t:r}" - [[ -n $PREBUFFER ]] && printf '# %s\n' "$(typeset_p PREBUFFER)" - [[ -n $BUFFER ]] && printf '# %s\n' "$(typeset_p BUFFER)" - # Load the data and prepare checking it. local BUFFER CURSOR MARK PENDING PREBUFFER REGION_ACTIVE WIDGET REPLY skip_test unsorted=0 local expected_mismatch @@ -145,7 +141,12 @@ run_test_internal() { expected_region_highlight=("${(@n)expected_region_highlight}") fi + # Print the plan line, and some comments for human readers echo "1..$(( $#expected_region_highlight + 1))" + echo "## ${1:t:r}" + [[ -n $PREBUFFER ]] && printf '# %s\n' "$(typeset_p PREBUFFER)" + [[ -n $BUFFER ]] && printf '# %s\n' "$(typeset_p BUFFER)" + local i for ((i=1; i<=$#expected_region_highlight; i++)); do local -a expected_highlight_zone; expected_highlight_zone=( ${(z)expected_region_highlight[i]} )