Fixes zsh-users/zsh-syntax-highlighting#182.
Prerequisite for testing issue #228.
* tests/test-highlighting.zsh
(run_test): Move functionality to run_test_internal; make run_test be a wrapper
that handles creating and cleaning up the tempdir.
* tests/README.md: Document the new feature.
* "highlighters/main/test-data/path-space- .zsh"
* highlighters/main/test-data/path-tilde-named.zsh
* highlighters/main/test-data/path.zsh
Change test data to not depend on being run from the source directory.
The following warnings are issued by zsh as of zsh-workers/37018 (commit
de9effbce601 to zsh itself):
_zsh_highlight_main_highlighter_highlight_dollar_string:17: array parameter match created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: array parameter mbegin created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: array parameter mend created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: numeric parameter parameter MBEGIN created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: numeric parameter parameter MEND created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_dollar_string:17: scalar parameter MATCH created globally in function _zsh_highlight_main_highlighter_highlight_dollar_string
_zsh_highlight_main_highlighter_highlight_string:11: array parameter match created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: array parameter mbegin created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: array parameter mend created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: numeric parameter parameter MBEGIN created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: numeric parameter parameter MEND created globally in function _zsh_highlight_main_highlighter_highlight_string
_zsh_highlight_main_highlighter_highlight_string:11: scalar parameter MATCH created globally in function _zsh_highlight_main_highlighter_highlight_string
zsh prior to workers/32609 (commit 9d47e8398d299e53ffe4e7ddf3731d2fedae9948)
does not support the (-n)-less «[[ $var ]]» syntax.
Fixeszsh-users/zsh-syntax-highlighting#225.
These tests are based on the patches contributed in those issues:
commit 9d9df4fe80 (upstream/pr/167)
Author: Miciah Masters <miciah.masters@gmail.com>
AuthorDate: Thu Apr 23 20:28:24 2015 -0400
Commit: Miciah Dashiel Butler Masters <mmasters@redhat.com>
CommitDate: Thu Apr 23 20:28:24 2015 -0400
Highlight comments
M highlighters/main/main-highlighter.zsh
A highlighters/main/test-data/comments.zsh
commit d94f1a037f (upstream/pr/163)
Author: sonnym <michaud.sonny@gmail.com>
AuthorDate: Fri Mar 6 18:27:57 2015 -0500
Commit: sonnym <michaud.sonny@gmail.com>
CommitDate: Fri Mar 6 21:16:27 2015 -0500
highlight comments when interactive_comments is on
M highlighters/main/main-highlighter.zsh
A highlighters/main/test-data/comment-embedded.zsh
A highlighters/main/test-data/comment-leading.zsh
Patch-by: sonnym <michaud.sonny@gmail.com>
Patch-by: Miciah Masters <miciah.masters@gmail.com>
(corrected and refreshed for harness changes by me)
The change of behaviour is triggered by test-data/sudo-redirection.zsh: the iteration
on "otheruser" sets $next_word to ":regular::sudo_opt::start::sudo_opt::start:" before
this patch, but to ":regular::sudo_opt::start:" after it (note the deduplication).
The fix for issue #9 was accidentally broken by the penultimate commit.
Note that we don't care about aliases to ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR
entries, since the code deals with aliases at command position.
Use this to remove [path_prefix] highlighting during accept-* widgets.
This causes ": file.tx<CR>" to remove the underline from "file.tx", like
": file.tx<SPACE>" already does. (Assume 'file.txt' exists.)
It's the widget's caller's responsibility, not ours, to add '--' where due. If
we do it, two instances of '--' might result. (I haven't been able to provoke
this problem.)
If this commit causes problems, the cause would be widget-callers that don't
pass '--' although they should.
test failure would not be reflected by the exit code of 'make'.
Setting a shell parameter in the left-hand side of a pipe is not visible to
commands after the pipe, because the left-hand side forks. (That's true both
in 'sh' used by 'make' and in 'zsh' that runs tests/test-highlighting.zsh, at
least on my system.) Therefore, move the colorizing hook to where it doesn't
interfere with setting the $something_failed (in tests/test-highlighting.zsh)
and $result (in Makefile) parameters.