Skip to content

Commit

Permalink
tests: Fix a wrong value of $PREBUFFER in a test, and add checks to p…
Browse files Browse the repository at this point in the history
…revent this from recurring.

Discussed: #706 (comment)
  • Loading branch information
danielshahaf committed Jun 11, 2020
1 parent f6f7a91 commit f6471db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion highlighters/main/test-data/path_prefix3.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# Assumes that '/bin/sh' exists and '/bin/s' does not exist.
# Related to path_prefix.zsh

PREBUFFER='ls \'
PREBUFFER=$'ls \\\n'
BUFFER='/bin/s'

expected_region_highlight=(
Expand Down
1 change: 1 addition & 0 deletions tests/test-highlighting.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ run_test_internal() {

# Check the data declares $PREBUFFER or $BUFFER.
[[ -z $PREBUFFER && -z $BUFFER ]] && { echo >&2 "Bail out! On ${(qq)ARG}: Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank"; return ${RETURN:=1}; }
[[ $PREBUFFER == (''|*$'\n') ]] || { echo >&2 "Bail out! On ${(qq)ARG}: PREBUFFER=${(qqqq)PREBUFFER} doesn't end with a newline"; return ${RETURN:=1}; }

# Set sane defaults for ZLE variables
: ${CURSOR=$#BUFFER} ${PENDING=0} ${WIDGET=z-sy-h-test-harness-test-widget}
Expand Down

0 comments on commit f6471db

Please sign in to comment.