From 2919679ee89dfaf34a336050c4013215ee2e2677 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 14 Dec 2017 20:44:20 -0600 Subject: [PATCH] tests: Skip when zsh/pcre is not available --- highlighters/regexp/test-data/word-boundary.zsh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/highlighters/regexp/test-data/word-boundary.zsh b/highlighters/regexp/test-data/word-boundary.zsh index d1f89d9..e852b8a 100644 --- a/highlighters/regexp/test-data/word-boundary.zsh +++ b/highlighters/regexp/test-data/word-boundary.zsh @@ -27,12 +27,16 @@ # vim: ft=zsh sw=2 ts=2 et # ------------------------------------------------------------------------------------------------- -setopt RE_MATCH_PCRE +if zmodload -s zsh/pcre; then + setopt RE_MATCH_PCRE -ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' 'fg=white,bold,bg=red') + ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' 'fg=white,bold,bg=red') -BUFFER='sudo ls' + BUFFER='sudo ls' -expected_region_highlight=( - "1 4 fg=white,bold,bg=red" -) + expected_region_highlight=( + "1 4 fg=white,bold,bg=red" + ) +else + skip_test='Test requires zsh/pcre' +fi