summaryrefslogtreecommitdiff
path: root/dotfiles/system/.zsh/modules/Test/B05eval.ztst
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-05-08 18:49:34 -0500
committerCraig Jennings <c@cjennings.net>2025-05-08 18:51:59 -0500
commit000e00871830cd15de032c80e2b62946cf19445c (patch)
tree794a7922750472bbe0e024042d6ba84f411fc3e0 /dotfiles/system/.zsh/modules/Test/B05eval.ztst
parentfe302606931e4bad91c4ed6df81a4403523ba780 (diff)
adding missing dotfiles and folders
- profile.d/ - bashrc - authinfo.gpg - .zsh/
Diffstat (limited to 'dotfiles/system/.zsh/modules/Test/B05eval.ztst')
-rw-r--r--dotfiles/system/.zsh/modules/Test/B05eval.ztst34
1 files changed, 34 insertions, 0 deletions
diff --git a/dotfiles/system/.zsh/modules/Test/B05eval.ztst b/dotfiles/system/.zsh/modules/Test/B05eval.ztst
new file mode 100644
index 0000000..6427d6f
--- /dev/null
+++ b/dotfiles/system/.zsh/modules/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