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