mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-02-27 10:25:32 +08:00
minor: test harness: Convert some global failure modes to TAP "Bail out" mode.
This commit is contained in:
parent
20d106bd4d
commit
663c760cc9
@ -31,20 +31,20 @@
|
|||||||
|
|
||||||
# Check an highlighter was given as argument.
|
# Check an highlighter was given as argument.
|
||||||
[[ -n "$1" ]] || {
|
[[ -n "$1" ]] || {
|
||||||
echo "You must provide the name of a valid highlighter as argument." >&2
|
echo >&2 "Bail out! You must provide the name of a valid highlighter as argument."
|
||||||
exit 1
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check the highlighter is valid.
|
# Check the highlighter is valid.
|
||||||
[[ -f ${0:h:h}/highlighters/$1/$1-highlighter.zsh ]] || {
|
[[ -f ${0:h:h}/highlighters/$1/$1-highlighter.zsh ]] || {
|
||||||
echo "Could not find highlighter '$1'." >&2
|
echo >&2 "Bail out! Could not find highlighter '$1'."
|
||||||
exit 1
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check the highlighter has test data.
|
# Check the highlighter has test data.
|
||||||
[[ -d ${0:h:h}/highlighters/$1/test-data ]] || {
|
[[ -d ${0:h:h}/highlighters/$1/test-data ]] || {
|
||||||
echo "Highlighter '$1' has no test data." >&2
|
echo >&2 "Bail out! Highlighter '$1' has no test data."
|
||||||
exit 1
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
# Load the main script.
|
# Load the main script.
|
||||||
|
Loading…
Reference in New Issue
Block a user