xref: /freebsd/bin/sh/tests/parser/heredoc2.0 (revision ebacd8013fe5f7fdf9f6a5b286f6680dd2891036)
1# $FreeBSD$
2
3failures=0
4
5check() {
6	if ! eval "[ $* ]"; then
7		echo "Failed: $*"
8		: $((failures += 1))
9	fi
10}
11
12s='ast*que?non' sq=\' dq=\"
13
14check '"$(cat <<EOF
15${s}
16EOF
17)" = "ast*que?non"'
18
19check '"$(cat <<EOF
20${s+'$sq'x'$sq'}
21EOF
22)" = ${sq}x${sq}'
23
24check '"$(cat <<EOF
25${s#ast}
26EOF
27)" = "*que?non"'
28
29check '"$(cat <<EOF
30${s##"ast"}
31EOF
32)" = "*que?non"'
33
34check '"$(cat <<EOF
35${s##'$sq'ast'$sq'}
36EOF
37)" = "*que?non"'
38
39exit $((failures != 0))
40