From b1688305cc83e63104d4c581f649bbdcffa0e3b8 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 21 Nov 2015 23:56:25 -0800 Subject: 37181: consistent use of zmodload and corresponding ZTST_unimplemented or ZTST_skip --- Test/C02cond.ztst | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'Test/C02cond.ztst') diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst index e9a596a22..40bbf424a 100644 --- a/Test/C02cond.ztst +++ b/Test/C02cond.ztst @@ -257,7 +257,7 @@ F:Failures in these cases do not indicate a problem in the shell. >status = 1 # core dumps on failure - if zmodload -i zsh/regex 2>/dev/null; then + if zmodload zsh/regex 2>/dev/null; then echo >regex_test.sh 'if [[ $# = 1 ]]; then if [[ $1 =~ /?[^/]+:[0-9]+:$ ]]; then : @@ -268,7 +268,8 @@ F:Failures in these cases do not indicate a problem in the shell. fi 0:regex tests shouldn't crash - (if zmodload -i zsh/regex 2>/dev/null; then + if zmodload zsh/regex 2>/dev/null; then + ( # subshell in case coredump test failed string="this has stuff in it" bad_regex=0 if [[ $string =~ "h([a-z]*) s([a-z]*) " ]]; then @@ -295,23 +296,26 @@ F:Failures in these cases do not indicate a problem in the shell. else print -r "regex failed to match '$string'" fi + ) else # if it didn't load, tough, but not a test error - print OK - fi) + ZTST_skip="regexp library not found." + fi 0:MATCH, MBEGIN, MEND, match, mbegin, mend >OK - (if zmodload -i zsh/regex 2>/dev/null; then + if zmodload zsh/regex 2>/dev/null; then + ( # subshell because regex module may dump core, see above if [[ a =~ a && b == b ]]; then print OK else print "regex =~ inverted following test" fi + ) else # not a test error - print OK - fi) + ZTST_skip="regexp library not found." + fi 0:regex infix operator should not invert following conditions >OK -- cgit 1.4.1