mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
tests: Provide an independent, auto-cleaned working directory to each test.
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.
This commit is contained in:
parent
b5d02a2f49
commit
c015339202
5 changed files with 37 additions and 11 deletions
|
|
@ -27,11 +27,13 @@
|
|||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
hash -d D=highlighters/main/test-data
|
||||
mkdir mydir
|
||||
touch mydir/path-tilde-named.test
|
||||
hash -d D=mydir
|
||||
|
||||
BUFFER='ls ~D/path-tilde-named.zsh'
|
||||
BUFFER='ls ~D/path-tilde-named.test'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls
|
||||
"4 26 $ZSH_HIGHLIGHT_STYLES[path]" # ~D/path-tilde-named.zsh
|
||||
"4 27 $ZSH_HIGHLIGHT_STYLES[path]" # ~D/path-tilde-named.test
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue