about summary refs log tree commit diff
path: root/Test/A01grammar.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2017-08-09 19:57:47 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-08-09 19:57:47 +0100
commitcfd34c75ac10e05a9573f6b26d3cb2d08b269f6a (patch)
tree0fcf5d73fb8340638e25055c63415b8410ffe670 /Test/A01grammar.ztst
parent23af20d0b9ecd40e401f44d8615e096e0081b427 (diff)
downloadzsh-cfd34c75ac10e05a9573f6b26d3cb2d08b269f6a.tar.gz
zsh-cfd34c75ac10e05a9573f6b26d3cb2d08b269f6a.tar.xz
zsh-cfd34c75ac10e05a9573f6b26d3cb2d08b269f6a.zip
41504: make empty strings work in case patterns with no leading parenthesis
Diffstat (limited to 'Test/A01grammar.ztst')
-rw-r--r--Test/A01grammar.ztst37
1 files changed, 37 insertions, 0 deletions
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 9625a15bc..0302c9624 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -820,6 +820,43 @@
 0:case keeps exit status of last command executed in compound-list
 >37
 
+  case '' in
+    burble) print No.
+    ;;
+    spurble|) print Yes!
+    ;;
+    |burble) print Not quite.
+    ;;
+  esac
+  case '' in
+    burble) print No.
+    ;;
+    |burble) print Wow!
+    ;;
+    spurble|) print Sorry.
+    ;;
+  esac
+  case '' in
+    gurgle) print No.
+    ;;
+    wurgle||jurgle) print Yikes!
+    ;;
+    durgle|) print Hmm.
+    ;;
+    |zurgle) print Hah.
+    ;;
+  esac
+  case '' in
+    # Useless doubled empty string to check special case.
+    ||jurgle) print Ok.
+    ;;
+  esac
+0: case with no opening parentheses and empty string 
+>Yes!
+>Wow!
+>Yikes!
+>Ok.
+
   x=1
   x=2 | echo $x
   echo $x