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:
Daniel Shahaf
2015-11-16 22:54:52 +00:00
parent b5d02a2f49
commit c015339202
5 changed files with 37 additions and 11 deletions

View File

@@ -27,9 +27,11 @@
# vim: ft=zsh sw=2 ts=2 et
# -------------------------------------------------------------------------------------------------
BUFFER='ls highlighters/main/test-data/path.zsh'
mkdir A
touch A/mu
BUFFER='ls A/mu'
expected_region_highlight=(
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"4 39 $ZSH_HIGHLIGHT_STYLES[path]" # highlighters/main/test-data/path.zsh
"1 2 $ZSH_HIGHLIGHT_STYLES[command]" # ls
"4 7 $ZSH_HIGHLIGHT_STYLES[path]" # A/mu
)