xref: /freebsd/bin/sh/tests/expansion/ifs3.0 (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
1
2failures=0
3unset LC_ALL
4export LC_CTYPE=en_US.ISO8859-1
5i=128
6set -f
7while [ "$i" -le 255 ]; do
8	i2=$((i^2))
9	c=$(printf \\"$(printf %o "$i")")
10	c2=$(printf \\"$(printf %o "$i2")")
11	IFS=$c
12	set -- $c2$c$c2$c$c2
13	if [ "$#" -ne 3 ] || [ "$1" != "$c2" ] || [ "$2" != "$c2" ] ||
14	    [ "$3" != "$c2" ]; then
15		echo "Bad results for separator $i (word $i2)" >&2
16		: $((failures += 1))
17	fi
18	i=$((i+1))
19done
20exit $((failures > 0))
21