1# Tests for the eval builtin.
2# This is quite short; eval is widely tested throughout the test suite
3# and its basic behaviour is fairly straightforward.
4
5%prep
6
7  cmd='print $?'
8
9%test
10
11  false
12  eval $cmd
130:eval retains value of $?
14>1
15
16  # no point getting worked up over what the error message is...
17  ./command_not_found 2>/dev/null
18  eval $cmd
190:eval after command not found
20>127
21
22  # trick the test system
23  sp=
24  false
25  eval "
26  $sp
27  $sp
28  $sp
29  "
300:eval with empty command resets the status
31
32  false
33  eval
340:eval with empty command resets the status
35