Ver código fonte

tests: Run tests with WARN_CREATE_GLOBAL

pull/453/head
Matthew Martin 6 anos atrás
pai
commit
038409c10d
4 arquivos alterados com 6 adições e 3 exclusões
  1. +1
    -1
      highlighters/main/test-data/commmand-parameter.zsh
  2. +1
    -1
      highlighters/main/test-data/path-dollared-word2.zsh
  3. +3
    -0
      tests/README.md
  4. +1
    -1
      tests/test-highlighting.zsh

+ 1
- 1
highlighters/main/test-data/commmand-parameter.zsh Ver arquivo

@ -27,7 +27,7 @@
# vim: ft=zsh sw=2 ts=2 et
# -------------------------------------------------------------------------------------------------
x=/usr/bin/env
local x=/usr/bin/env
BUFFER='$x "argument"'
expected_region_highlight=(

+ 1
- 1
highlighters/main/test-data/path-dollared-word2.zsh Ver arquivo

@ -27,7 +27,7 @@
# vim: ft=zsh sw=2 ts=2 et
# -------------------------------------------------------------------------------------------------
lambda="''"
local lambda="''"
touch \$lambda
BUFFER=': \$lambda'

+ 3
- 0
tests/README.md Ver arquivo

@ -21,6 +21,9 @@ point will not fail the test), and `$todo` is used as the explanation.
**Note**: `$region_highlight` uses the same `"$i $j $style"` syntax but
interprets the indexes differently.
**Note**: Tests are run with `setopt NOUNSET WARN_CREATE_GLOBAL`, so any
variables the test creates must be declared local.
**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. The

+ 1
- 1
tests/test-highlighting.zsh Ver arquivo

@ -29,7 +29,7 @@
# -------------------------------------------------------------------------------------------------
setopt NOUNSET
setopt NO_UNSET WARN_CREATE_GLOBAL
# Check an highlighter was given as argument.
[[ -n "$1" ]] || {

Carregando…
Cancelar
Salvar