diff options
author | Peter Stephenson <pws@zsh.org> | 2015-05-21 10:25:07 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2015-05-21 10:25:07 +0100 |
commit | afb78f5d142786169817709e6ec4c48637bcae93 (patch) | |
tree | 8401778d995425aa59aaba0bd7136f2db7c57a51 /Test | |
parent | af957f2ed6287f66953742fbca69188cecb98fbf (diff) | |
download | zsh-afb78f5d142786169817709e6ec4c48637bcae93.tar.gz zsh-afb78f5d142786169817709e6ec4c48637bcae93.tar.xz zsh-afb78f5d142786169817709e6ec4c48637bcae93.zip |
35248: treat fully parenthised zsh patterns as complete case patterns again
Diffstat (limited to 'Test')
-rw-r--r-- | Test/A01grammar.ztst | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index 41fb48688..50058e25d 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -614,7 +614,8 @@ >mytrue >END - fn() { + (emulate sh -c ' + fn() { case $1 in ( one | two | three ) print Matched $1 @@ -627,6 +628,7 @@ ;; esac } + ' which fn fn one fn two @@ -635,8 +637,8 @@ fn five fn six fn abecedinarian - fn xylophone -0: case word handling + fn xylophone) +0: case word handling in sh emulation (SH_GLOB parentheses) >fn () { > case $1 in > (one | two | three) print Matched $1 ;; @@ -665,3 +667,31 @@ 0: case patterns within words >1 OK >2 OK + + case horrible in + ([a-m])(|[n-z])rr(|ib(um|le|ah))) + print It worked + ;; + esac + case "a string with separate words" in + (*with separate*)) + print That worked, too + ;; + esac +0:Unbalanced parentheses and spaces with zsh pattern +>It worked +>That worked, too + + case horrible in + (([a-m])(|[n-z])rr(|ib(um|le|ah))) + print It worked + ;; + esac + case "a string with separate words" in + (*with separate*) + print That worked, too + ;; + esac +0:Balanced parentheses and spaces with zsh pattern +>It worked +>That worked, too |