dev tools: Add a script that generates a test-data file.

This commit is contained in:
Daniel Shahaf
2016-07-28 23:15:32 +00:00
parent fa57633d81
commit 8013dc3b8d
2 changed files with 102 additions and 0 deletions

View File

@@ -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
-----------------