about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-01-06 17:05:17 +0000
committerPeter Stephenson <pws@zsh.org>2015-01-08 12:24:00 +0000
commitc0d01a6fe0c67911650730cf13a2b9a0db16e59b (patch)
tree617d685ec8fabe09e1b83874d961436b86b16259 /Test
parent93846edb0d5d606e167f929532608eaea273c23f (diff)
downloadzsh-c0d01a6fe0c67911650730cf13a2b9a0db16e59b.tar.gz
zsh-c0d01a6fe0c67911650730cf13a2b9a0db16e59b.tar.xz
zsh-c0d01a6fe0c67911650730cf13a2b9a0db16e59b.zip
Fix command substitutions to parse contents as they are read in.
Do this by refactoring misnamed lexsave()/lexrestore() to allow
continuity of history and input.

Add test.
Diffstat (limited to 'Test')
-rw-r--r--Test/D08cmdsubst.ztst42
1 files changed, 42 insertions, 0 deletions
diff --git a/Test/D08cmdsubst.ztst b/Test/D08cmdsubst.ztst
index 5661b0aaa..a4c69a010 100644
--- a/Test/D08cmdsubst.ztst
+++ b/Test/D08cmdsubst.ztst
@@ -106,3 +106,45 @@
 >34
 >"
 >" OK
+
+ echo $(case foo in
+ foo)
+ echo This test worked.
+ ;;
+ bar)
+ echo This test failed in a rather bizarre way.
+ ;;
+ *)
+ echo This test failed.
+ ;;
+ esac)
+0:Parsing of command substitution with unmatched parentheses: case, basic
+>This test worked.
+
+ echo "$(case bar in
+ foo)
+ echo This test spoobed.
+ ;;
+ bar)
+ echo This test plurbled.
+ ;;
+ *)
+ echo This test bzonked.
+ ;;
+ esac)"
+0:Parsing of command substitution with unmatched parentheses: case with quotes
+>This test plurbled.
+
+ echo before $(
+ echo start; echo unpretentious |
+ while read line; do
+   case $line in
+   u*)
+   print Word began with u
+   print and ended with a crunch
+   ;;
+   esac
+ done | sed -e 's/Word/Universe/'; echo end
+ ) after
+0:Parsing of command substitution with ummatched parentheses: with frills
+>before start Universe began with u and ended with a crunch end after