xref: /freebsd/bin/sh/tests/parser/func1.0 (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
1# POSIX does not require these bytes to work in function names,
2# but making them all work seems a good goal.
3
4failures=0
5unset LC_ALL
6export LC_CTYPE=en_US.ISO8859-1
7i=128
8set -f
9while [ "$i" -le 255 ]; do
10	c=$(printf \\"$(printf %o "$i")")
11	ok=0
12	eval "$c() { ok=1; }"
13	$c
14	ok1=$ok
15	ok=0
16	"$c"
17	if [ "$ok" != 1 ] || [ "$ok1" != 1 ]; then
18		echo "Bad results for character $i" >&2
19		: $((failures += 1))
20	fi
21	unset -f $c
22	i=$((i+1))
23done
24exit $((failures > 0))
25