test harness: Actually test the new code.

Currently, without zsh/zle loaded, the tests silently fall back to the
5.2-and-earlier codepath; see:
.
    https://github.com/zsh-users/zsh-syntax-highlighting/pull/356#issuecomment-243651251
This commit is contained in:
Daniel Shahaf 2016-10-17 17:51:04 +00:00 committed by Matthew Martin
parent b5249f17ab
commit a868b6942e
3 changed files with 9 additions and 0 deletions

View File

@ -31,6 +31,9 @@
emulate -LR zsh emulate -LR zsh
setopt localoptions extendedglob setopt localoptions extendedglob
# Required for add-zle-hook-widget.
zmodload zsh/zle
# Argument parsing. # Argument parsing.
if (( $# != 3 )) || [[ $1 == -* ]]; then if (( $# != 3 )) || [[ $1 == -* ]]; then
print -r -- >&2 "$0: usage: $0 BUFFER HIGHLIGHTER BASENAME" print -r -- >&2 "$0: usage: $0 BUFFER HIGHLIGHTER BASENAME"

View File

@ -31,6 +31,9 @@
setopt NO_UNSET WARN_CREATE_GLOBAL setopt NO_UNSET WARN_CREATE_GLOBAL
# Required for add-zle-hook-widget.
zmodload zsh/zle
# Check an highlighter was given as argument. # Check an highlighter was given as argument.
[[ -n "$1" ]] || { [[ -n "$1" ]] || {
echo >&2 "Bail out! You must provide the name of a valid highlighter as argument." echo >&2 "Bail out! You must provide the name of a valid highlighter as argument."

View File

@ -29,6 +29,9 @@
# ------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------
# Required for add-zle-hook-widget.
zmodload zsh/zle
# Check an highlighter was given as argument. # Check an highlighter was given as argument.
[[ -n "$1" ]] || { [[ -n "$1" ]] || {
echo >&2 "Bail out! You must provide the name of a valid highlighter as argument." echo >&2 "Bail out! You must provide the name of a valid highlighter as argument."