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