sh: Split off a more dubious test from parser/heredoc2.0.

This commit is contained in:
Jilles Tjoelker 2010-08-16 21:14:49 +00:00
parent 54be88c948
commit 2070b57f64
2 changed files with 20 additions and 5 deletions

View File

@ -16,11 +16,6 @@ ${s}
EOF
)" = "ast*que?non"'
check '"$(cat <<EOF
${s+"x"}
EOF
)" = ${dq}x${dq}'
check '"$(cat <<EOF
${s+'$sq'x'$sq'}
EOF

View File

@ -0,0 +1,20 @@
# $FreeBSD$
failures=0
check() {
if ! eval "[ $* ]"; then
echo "Failed: $*"
: $((failures += 1))
fi
}
s='ast*que?non' sq=\' dq=\"
# This is possibly useful but differs from other shells.
check '"$(cat <<EOF
${s+"x"}
EOF
)" = ${dq}x${dq}'
exit $((failures != 0))