Skip to content

Commit f6f7a91

Browse files
committed
test harness: Fix use of an undefined variable in an error message.
The error message uses «$1», but it is always unset at that point. Furthermore, the NO_UNSET (-u) option is in effect. Therefore, when the error message was to be printed, zsh's NO_UNSET error message was printed instead: . (anon):20: 1: parameter not set That error message was printed to stderr, and was caught by the caller within the test harness: . Bail out! On './highlighters/main/test-data/path_prefix3.zsh': output on stderr Thus, the bug being fixed would not caused false positive or false negative test results, but only wrong error messages. Follow-up to 0.7.1-71-ge6eea1f, "test harness: Don't leak options from test files to the test harness".
1 parent 6fd92e1 commit f6f7a91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test-highlighting.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ run_test_internal() {
144144
}
145145

146146
# Check the data declares $PREBUFFER or $BUFFER.
147-
[[ -z $PREBUFFER && -z $BUFFER ]] && { echo >&2 "Bail out! On ${(qq)1}: Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank"; return ${RETURN:=1}; }
147+
[[ -z $PREBUFFER && -z $BUFFER ]] && { echo >&2 "Bail out! On ${(qq)ARG}: Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank"; return ${RETURN:=1}; }
148148

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

0 commit comments

Comments
 (0)