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