sh: Split off some special behavior into separate regress tests.
[dragonfly.git] / tools / regression / bin / sh / parser / for1.0
CommitLineData
ec6257fc 1# $FreeBSD: src/tools/regression/bin/sh/parser/for1.0,v 1.3 2011/02/20 14:18:58 jilles Exp $
3df4d8b0
PA
2
3nl='
4'
5list=' a b c'
6for s1 in "$nl" " "; do
7 for s2 in "$nl" ";" ";$nl"; do
8 for s3 in "$nl" " "; do
9 r=''
10 eval "for i${s1}in ${list}${s2}do${s3}r=\"\$r \$i\"; done"
11 [ "$r" = "$list" ] || exit 1
12 done
13 done
14done
15set -- $list
ec6257fc 16for s2 in "$nl" " "; do
3df4d8b0
PA
17 for s3 in "$nl" " "; do
18 r=''
19 eval "for i${s2}do${s3}r=\"\$r \$i\"; done"
20 [ "$r" = "$list" ] || exit 1
21 done
22done
23for s1 in "$nl" " "; do
24 for s2 in "$nl" ";" ";$nl"; do
25 for s3 in "$nl" " "; do
26 eval "for i${s1}in${s2}do${s3}exit 1; done"
27 done
28 done
29done