trim5.0 revision 214490
1203945Sweongyo# $FreeBSD: head/tools/regression/bin/sh/expansion/trim5.0 214490 2010-10-28 21:51:14Z jilles $ 2203945Sweongyo 3203945Sweongyoe= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}' 4203945Sweongyoh='##' 5203945Sweongyofailures='' 6203945Sweongyook='' 7203945Sweongyo 8203945Sweongyotestcase() { 9203945Sweongyo code="$1" 10239462Sdim expected="$2" 11239462Sdim oIFS="$IFS" 12239462Sdim eval "$code" 13239462Sdim 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 29