mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
dev tools: Add a script that generates a test-data file.
This commit is contained in:
parent
fa57633d81
commit
8013dc3b8d
2 changed files with 102 additions and 0 deletions
|
|
@ -39,6 +39,25 @@ which is automatically cleaned up after the test exits. For example:
|
|||
"1 21 command" # bar/testing-issue-228
|
||||
)
|
||||
|
||||
|
||||
Writing new tests
|
||||
-----------------
|
||||
|
||||
An experimental tool is available to generate test files:
|
||||
|
||||
zsh -f tests/generate.zsh 'ls -x' \
|
||||
| sed s/YYYY/$(date +%Y)/ \
|
||||
> highlighters/main/test-data/foo.zsh
|
||||
git add -N $_
|
||||
|
||||
This generates a test file based on the current highlighting of the given `$BUFFER`
|
||||
(in this case, `ls -x`).
|
||||
|
||||
_This tool is experimental._ Its interface may change. In particular it may
|
||||
grow ways to set `$PREBUFFER` and/or `$ZSH_HIGHLIGHT_HIGHLIGHTERS` or to
|
||||
inject free-form code into the generated file.
|
||||
|
||||
|
||||
Highlighting test
|
||||
-----------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue