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:
@@ -17,7 +17,8 @@ _Note_: `$region_highlight` uses the same `"$i $j $style"` syntax but interprets
|
||||
|
||||
**Isolation**: Each test is run in a separate subshell, so any variables, aliases, functions, etc.,
|
||||
it defines will be visible to the tested code (that computes `$region_highlight`), but will not affect
|
||||
subsequent tests.
|
||||
subsequent tests. The current working directory of tests is set to a newly-created empty directory,
|
||||
which is automatically cleaned up after the test exits.
|
||||
|
||||
|
||||
highlighting test
|
||||
|
||||
Reference in New Issue
Block a user