From 67be62107be0882f7ca09a191ffbafcb1ee9097a Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 2 Dec 2016 09:50:55 +0000 Subject: [PATCH] tests: Move some code in preparation for next commit. No functional change. --- tests/test-highlighting.zsh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index 1d169d6..6f7fa96 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -47,6 +47,19 @@ exit 2 } +# Set up results_filter +local results_filter +if [[ $QUIET == y ]]; then + if type -w perl >/dev/null; then + results_filter=${0:A:h}/tap-filter + else + echo >&2 "Bail out! quiet mode not supported: perl not found"; exit 2 + fi +else + results_filter=cat +fi +[[ -n $results_filter ]] || { echo >&2 "Bail out! BUG setting \$results_filter"; exit 2 } + # Load the main script. . ${0:h:h}/zsh-syntax-highlighting.zsh @@ -157,19 +170,6 @@ run_test() { } } -# Set up results_filter -local results_filter -if [[ $QUIET == y ]]; then - if type -w perl >/dev/null; then - results_filter=${0:A:h}/tap-filter - else - echo >&2 "Bail out! quiet mode not supported: perl not found"; exit 2 - fi -else - results_filter=cat -fi -[[ -n $results_filter ]] || { echo >&2 "Bail out! BUG setting \$results_filter"; exit 2 } - # Process each test data file in test data directory. integer something_failed=0 ZSH_HIGHLIGHT_STYLES=()