xref: /freebsd/bin/sh/tests/expansion/ifs3.0 (revision e0c4386e7e71d93b0edc0c8fa156263fc4a8b0b6)
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