]> git.saurik.com Git - apple/shell_cmds.git/blame - sh/tests/expansion/cmdsubst7.0
shell_cmds-216.60.1.tar.gz
[apple/shell_cmds.git] / sh / tests / expansion / cmdsubst7.0
CommitLineData
deb63bfb 1# $FreeBSD: head/bin/sh/tests/expansion/cmdsubst7.0 216778 2010-12-28 21:27:08Z jilles $
71aad674
A
2
3failures=''
4ok=''
5
6testcase() {
7 code="$1"
8
9 unset v
10 eval ": \$($code)"
11
12 if [ "${v:+bad}" = "" ]; then
13 ok=x$ok
14 else
15 failures=x$failures
16 echo "Failure for $code"
17 fi
18}
19
20testcase ': ${v=0}'
21testcase ': ${v:=0}'
22testcase ': $((v=1))'
23testcase ': $((v+=1))'
24w='v=1'
25testcase ': $(($w))'
26testcase ': $((${$+v=1}))'
27testcase ': $((v${$+=1}))'
28testcase ': $((v $(echo =) 1))'
29testcase ': $(($(echo $w)))'
30
31test "x$failures" = x