From 3414c7c0d29963075b99a6946efb0e2304ad881b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 22 Feb 2020 14:33:39 +0000 Subject: [PATCH] test harness: Include $PREBUFFER and $BUFFER in the output. For human readers' benefit. --- tests/test-highlighting.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index 91534ef..6583d2d 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -117,12 +117,15 @@ 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}" - # Load the data and prepare checking it. local BUFFER CURSOR MARK PENDING PREBUFFER REGION_ACTIVE WIDGET REPLY skip_test unsorted=0 local expected_mismatch local -a expected_region_highlight region_highlight + + echo "# ${1:t:r}" + [[ -n $PREBUFFER ]] && printf '# %s\n' "$(typeset_p PREBUFFER)" + [[ -n $BUFFER ]] && printf '# %s\n' "$(typeset_p BUFFER)" + . "$srcdir"/"$1" (( $#skip_test )) && { print -r -- "1..0 # SKIP $skip_test"; return; }