about summary refs log tree commit diff
path: root/Test/B05eval.ztst
blob: 6427d6f2c15af43c0a08c9abfcaa414c58e0acbe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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