about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-08-06 19:51:04 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-08-06 19:51:04 +0000
commitc4f33330f6797d0c199abf522f79c3ccac88ed55 (patch)
treede3b9cbfb26c313b774a3df1b63c8191dcebc775 /Test
parentd026334a3b25a2150d59a3f53a20d39ddb96ab56 (diff)
downloadzsh-c4f33330f6797d0c199abf522f79c3ccac88ed55.tar.gz
zsh-c4f33330f6797d0c199abf522f79c3ccac88ed55.tar.xz
zsh-c4f33330f6797d0c199abf522f79c3ccac88ed55.zip
25409: fix eval's use of lastval
Diffstat (limited to 'Test')
-rw-r--r--Test/.distfiles1
-rw-r--r--Test/B05eval.ztst34
2 files changed, 35 insertions, 0 deletions
diff --git a/Test/.distfiles b/Test/.distfiles
index d79079696..6fd78491b 100644
--- a/Test/.distfiles
+++ b/Test/.distfiles
@@ -11,6 +11,7 @@ B01cd.ztst
 B02typeset.ztst
 B03print.ztst
 B04read.ztst
+B05eval.ztst
 C01arith.ztst
 C02cond.ztst
 C03traps.ztst
diff --git a/Test/B05eval.ztst b/Test/B05eval.ztst
new file mode 100644
index 000000000..6427d6f2c
--- /dev/null
+++ b/Test/B05eval.ztst
@@ -0,0 +1,34 @@
+# Tests for the eval builtin.
+# This is quite short; eval is widely tested throughout the test suite
+# and its basic behaviour is fairly straightforward.
+
+%prep
+
+  cmd='print $?'
+
+%test
+
+  false
+  eval $cmd
+0:eval retains value of $?
+>1
+
+  # no point getting worked up over what the error message is...
+  ./command_not_found 2>/dev/null
+  eval $cmd
+0:eval after command not found
+>127
+
+  # trick the test system
+  sp=
+  false
+  eval "
+  $sp
+  $sp
+  $sp
+  "
+0:eval with empty command resets the status
+
+  false
+  eval
+0:eval with empty command resets the status