summaryrefslogtreecommitdiff
path: root/Test/C02cond.ztst
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-11-21 23:56:25 -0800
committerBarton E. Schaefer <schaefer@zsh.org>2015-11-21 23:56:25 -0800
commitb1688305cc83e63104d4c581f649bbdcffa0e3b8 (patch)
treecb398b147c03d54bb79e071d810acde5c81b501f /Test/C02cond.ztst
parentcce4261a3c6f4bf78b483db61623c80e3c98d10b (diff)
downloadzsh-b1688305cc83e63104d4c581f649bbdcffa0e3b8.tar.gz
zsh-b1688305cc83e63104d4c581f649bbdcffa0e3b8.zip
37181: consistent use of zmodload and corresponding ZTST_unimplemented or ZTST_skip
Diffstat (limited to 'Test/C02cond.ztst')
-rw-r--r--Test/C02cond.ztst18
1 files changed, 11 insertions, 7 deletions
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