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