xref: /freebsd/bin/sh/tests/expansion/ifs1.0 (revision 1c05a6ea6b849ff95e539c31adea887c644a6a01)
1# $FreeBSD$
2
3c=: e= s=' '
4failures=''
5ok=''
6
7check_result() {
8	if [ "x$2" = "x$3" ]; then
9		ok=x$ok
10	else
11		failures=x$failures
12		echo "For $1, expected $3 actual $2"
13	fi
14}
15
16IFS='
17'
18set -- a ''
19set -- "$@"
20check_result 'set -- "$@"' "($#)($1)($2)" "(2)(a)()"
21
22set -- a ''
23set -- "$@"$e
24check_result 'set -- "$@"$e' "($#)($1)($2)" "(2)(a)()"
25
26set -- a ''
27set -- "$@"$s
28check_result 'set -- "$@"$s' "($#)($1)($2)" "(2)(a)()"
29
30IFS="$c"
31set -- a ''
32set -- "$@"$c
33check_result 'set -- "$@"$c' "($#)($1)($2)" "(2)(a)()"
34
35test "x$failures" = x
36