xref: /freebsd/bin/sh/tests/parser/line-cont11.0 (revision a7623790fb345e6dc986dfd31df0ace115e6f2e4)
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