diff --git a/tests/README.md b/tests/README.md index e82a64b..80525ac 100644 --- a/tests/README.md +++ b/tests/README.md @@ -3,7 +3,9 @@ zsh-syntax-highlighting / tests Utility scripts for testing zsh-syntax-highlighting highlighters. -The tests expect the highlighter directory to contain a `test-data` directory with test data files. See the [main highlighter](../highlighters/main/test-data) for examples. +The tests harness expects the highlighter directory to contain a `test-data` +directory with test data files. +See the [main highlighter](../highlighters/main/test-data) for examples. Each test should define the array parameter `$expected_region_highlight`. The value of that parameter is a list of `"$i $j $style [$todo]"` strings. @@ -13,6 +15,10 @@ If `$todo` exists, the test point is marked as TODO (the failure of that test po _Note_: `$region_highlight` uses the same `"$i $j $style"` syntax but interprets the indexes differently. +**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. + highlighting test -----------------