mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-01-30 09:47:13 +08:00
test harness: Don't leak options from test files to the test harness.
Fixes an issue whereby the '# TODO "issue #687"' directive in the output of opt-shwordsplit1.zsh was truncated, because the test itself had set the SH_WORD_SPLIT option and that affected the evaluation of «${(z)expected_region_highlight[i]}» in the test harness. Furthermore, this patch also independently fixes the error under zsh-5.0.8 and earlier that was fixed by the previous commit.
This commit is contained in:
parent
99389327ae
commit
e6eea1f9b7
@ -123,7 +123,12 @@ run_test_internal() {
|
||||
local skip_mismatch
|
||||
local -a expected_region_highlight region_highlight
|
||||
|
||||
. "$srcdir"/"$1"
|
||||
local ARG="$1"
|
||||
() {
|
||||
setopt localoptions
|
||||
. "$srcdir"/"$ARG"
|
||||
|
||||
# WARNING: The remainder of this anonymous function will run with the test's options in effect
|
||||
|
||||
(( $#skip_test )) && { print -r -- "1..0 # SKIP $skip_test"; return; }
|
||||
|
||||
@ -137,6 +142,8 @@ run_test_internal() {
|
||||
|
||||
# Process the data.
|
||||
_zsh_highlight
|
||||
}
|
||||
unset ARG
|
||||
|
||||
if (( unsorted )); then
|
||||
region_highlight=("${(@n)region_highlight}")
|
||||
|
Loading…
Reference in New Issue
Block a user