]>
Commit | Line | Data |
---|---|---|
deb63bfb | 1 | # $FreeBSD: head/bin/sh/tests/expansion/cmdsubst7.0 216778 2010-12-28 21:27:08Z jilles $ |
71aad674 A |
2 | |
3 | failures='' | |
4 | ok='' | |
5 | ||
6 | testcase() { | |
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 | ||
20 | testcase ': ${v=0}' | |
21 | testcase ': ${v:=0}' | |
22 | testcase ': $((v=1))' | |
23 | testcase ': $((v+=1))' | |
24 | w='v=1' | |
25 | testcase ': $(($w))' | |
26 | testcase ': $((${$+v=1}))' | |
27 | testcase ': $((v${$+=1}))' | |
28 | testcase ': $((v $(echo =) 1))' | |
29 | testcase ': $(($(echo $w)))' | |
30 | ||
31 | test "x$failures" = x |