1
2failures=0
3
4check() {
5 if ! eval "[ $* ]"; then
6 echo "Failed: $*"
7 : $((failures += 1))
8 fi
9}
10
11s='ast*que?non' sq=\' dq=\"
12
13# This is possibly useful but differs from other shells.
14check '"$(cat <<EOF
15${s+"x"}
16EOF
17)" = ${dq}x${dq}'
18
19exit $((failures != 0))
20