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