1
0
Fork 0
mirror of https://github.com/zdharma-continuum/zinit-module.git synced 2024-11-21 13:27:58 +01:00
zinit-module/Test/B05eval.ztst
Philipp Schmitt e3af3f8ae8
🧹 Clean up! (#1)
2021-11-19 10:14:34 +01:00

34 lines
561 B
Text

# 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