From afb78f5d142786169817709e6ec4c48637bcae93 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 21 May 2015 10:25:07 +0100 Subject: 35248: treat fully parenthised zsh patterns as complete case patterns again --- Test/A01grammar.ztst | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'Test') 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 -- cgit 1.4.1