]> git.saurik.com Git - apple/shell_cmds.git/blame - sh/tests/expansion/trim5.0
shell_cmds-203.tar.gz
[apple/shell_cmds.git] / sh / tests / expansion / trim5.0
CommitLineData
deb63bfb 1# $FreeBSD: head/bin/sh/tests/expansion/trim5.0 214490 2010-10-28 21:51:14Z jilles $
71aad674
A
2
3e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}'
4h='##'
5failures=''
6ok=''
7
8testcase() {
9 code="$1"
10 expected="$2"
11 oIFS="$IFS"
12 eval "$code"
13 IFS='|'
14 result="$#|$*"
15 IFS="$oIFS"
16 if [ "x$result" = "x$expected" ]; then
17 ok=x$ok
18 else
19 failures=x$failures
20 echo "For $code, expected $expected actual $result"
21 fi
22}
23
24testcase 'set -- "${b%'\'}\''}"' '1|{{(#)}'
25testcase 'set -- ${b%"}"}' '1|{{(#)}'
26testcase 'set -- "${b%"}"}"' '1|{{(#)}'
27
28test "x$failures" = x