summary refs log tree commit diff
path: root/bin/cash/tests/expansion/trim5.0
blob: 572e5b0cae91d2e5f0524ddaa39d590070306488 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# $FreeBSD: releng/12.0/bin/sh/tests/expansion/trim5.0 214490 2010-10-28 21:51:14Z jilles $

e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}'
h='##'
failures=''
ok=''

testcase() {
	code="$1"
	expected="$2"
	oIFS="$IFS"
	eval "$code"
	IFS='|'
	result="$#|$*"
	IFS="$oIFS"
	if [ "x$result" = "x$expected" ]; then
		ok=x$ok
	else
		failures=x$failures
		echo "For $code, expected $expected actual $result"
	fi
}

testcase 'set -- "${b%'\'}\''}"'		'1|{{(#)}'
testcase 'set -- ${b%"}"}'			'1|{{(#)}'
testcase 'set -- "${b%"}"}"'			'1|{{(#)}'

test "x$failures" = x