From 5efd062a4d2c8fe37864a0108059a33e37656682 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 2 Dec 2016 09:35:29 +0000 Subject: [PATCH] tests: Add a regression test for issue #392 (aliases beginning with a '+' are lost). --- tests/test-highlighting.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index 6f7fa96..94c4152 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -61,7 +61,19 @@ fi [[ -n $results_filter ]] || { echo >&2 "Bail out! BUG setting \$results_filter"; exit 2 } # Load the main script. +# While here, test that it doesn't eat aliases. +print > >($results_filter | ${0:A:h}/tap-colorizer.zsh) -r -- "# global (driver) tests" +print > >($results_filter | ${0:A:h}/tap-colorizer.zsh) -r -- "1..1" +alias -- +plus=plus +alias -- _other=other +original_alias_dash_L_output="$(alias -L)" . ${0:h:h}/zsh-syntax-highlighting.zsh +if [[ $original_alias_dash_L_output == $(alias -L) ]]; then + print -r -- "ok 1 # 'alias -- +foo=bar' is preserved" +else + print -r -- "not ok 1 # 'alias -- +foo=bar' is preserved" + exit 1 +fi > >($results_filter | ${0:A:h}/tap-colorizer.zsh) # Overwrite _zsh_highlight_add_highlight so we get the key itself instead of the style _zsh_highlight_add_highlight()