xref: /freebsd/bin/sh/tests/parser/heredoc12.0 (revision 36712a94975f5bd0d26c85377283b49a2369c82f)
1# $FreeBSD$
2
3failures=0
4
5check() {
6	if ! eval "[ $* ]"; then
7		echo "Failed: $*"
8		: $((failures += 1))
9	fi
10}
11
12longmark=`printf %01000d 4`
13longmarkstripped=`printf %0999d 0`
14
15check '"$(cat <<'"$longmark
16$longmark"'
17echo yes)" = "yes"'
18
19check '"$(cat <<\'"$longmark
20$longmark"'
21echo yes)" = "yes"'
22
23check '"$(cat <<'"$longmark
24yes
25$longmark"'
26)" = "yes"'
27
28check '"$(cat <<\'"$longmark
29yes
30$longmark"'
31)" = "yes"'
32
33check '"$(cat <<'"$longmark
34$longmarkstripped
35$longmark.
36$longmark"'
37)" = "'"$longmarkstripped
38$longmark."'"'
39
40check '"$(cat <<\'"$longmark
41$longmarkstripped
42$longmark.
43$longmark"'
44)" = "'"$longmarkstripped
45$longmark."'"'
46
47exit $((failures != 0))
48