summary refs log tree commit diff
path: root/bin/cash/tests/parser/heredoc12.0
blob: 80714390879eb18147ccccff7cac8940bb6eb699 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# $FreeBSD: releng/12.0/bin/sh/tests/parser/heredoc12.0 271593 2014-09-14 16:46:30Z jilles $

failures=0

check() {
	if ! eval "[ $* ]"; then
		echo "Failed: $*"
		: $((failures += 1))
	fi
}

longmark=`printf %01000d 4`
longmarkstripped=`printf %0999d 0`

check '"$(cat <<'"$longmark
$longmark"'
echo yes)" = "yes"'

check '"$(cat <<\'"$longmark
$longmark"'
echo yes)" = "yes"'

check '"$(cat <<'"$longmark
yes
$longmark"'
)" = "yes"'

check '"$(cat <<\'"$longmark
yes
$longmark"'
)" = "yes"'

check '"$(cat <<'"$longmark
$longmarkstripped
$longmark.
$longmark"'
)" = "'"$longmarkstripped
$longmark."'"'

check '"$(cat <<\'"$longmark
$longmarkstripped
$longmark.
$longmark"'
)" = "'"$longmarkstripped
$longmark."'"'

exit $((failures != 0))