Selaa lähdekoodia

tests: Run harness in an anon function to catch global variables

Thanks Daniel for the set -- suggestion.
pull/543/head
Matthew Martin 5 vuotta sitten
vanhempi
commit
693757bfd7
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. +4
    -0
      tests/test-highlighting.zsh

+ 4
- 0
tests/test-highlighting.zsh Näytä tiedosto

@ -32,7 +32,10 @@
setopt NO_UNSET WARN_CREATE_GLOBAL
local -r root=${0:h:h}
local -a anon_argv; anon_argv=("$@")
(){
set -- "${(@)anon_argv}"
# Check an highlighter was given as argument.
[[ -n "$1" ]] || {
echo >&2 "Bail out! You must provide the name of a valid highlighter as argument."
@ -219,3 +222,4 @@ for data_file in $root/highlighters/$1/test-data/*.zsh; do
done
exit $something_failed
}

Ladataan…
Peruuta
Tallenna