From cfd34c75ac10e05a9573f6b26d3cb2d08b269f6a Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Wed, 9 Aug 2017 19:57:47 +0100
Subject: 41504: make empty strings work in case patterns with no leading
parenthesis
---
Test/A01grammar.ztst | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
(limited to 'Test/A01grammar.ztst')
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
--
cgit 1.4.1