xref: /freebsd/bin/sh/tests/parser/line-cont11.0 (revision 0a36787e4c1fa0cf77dcf83be0867178476e372b)
1# $FreeBSD$
2
3T=$(mktemp "${TMPDIR:-/tmp}/sh-test.XXXXXXXX") || exit
4trap 'rm -f -- "$T"' 0
5w='#A'
6# A naive pgetc_linecont() would push back two characters here, which
7# fails if a new buffer is read between the two characters.
8c='${w#\#}'
9c=$c$c$c$c
10c=$c$c$c$c
11c=$c$c$c$c
12c=$c$c$c$c
13c=$c$c$c$c
14c=$c$c$c$c
15printf 'v=%s\n' "$c" >"$T"
16. "$T"
17if [ "${#v}" != 4096 ]; then
18	echo "Length is bad (${#v})"
19	exit 3
20fi
21case $v in
22*[!A]*) echo "Content is bad"; exit 3 ;;
23esac
24