mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
Restore two commented-out tests from plus-minus1.0 to a new file.
These two cases pass on -CURRENT but fail on stable/8. Reviewed by: jilles
This commit is contained in:
parent
88d5e71efe
commit
f8e809686a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216738
@ -43,9 +43,6 @@ testcase 'set -- ${e:+$w"$e"}' '0|'
|
||||
testcase 'set -- ${w:+"$w"}' '1|a b c'
|
||||
testcase 'set -- ${w:+$w"$w"}' '3|a|b|ca b c'
|
||||
|
||||
# These two are known broken in FreeBSD /bin/sh
|
||||
#testcase 'set -- ${s+a b}' '2|a|b'
|
||||
#testcase 'set -- ${e:-a b}' '2|a|b'
|
||||
testcase 'set -- "${s+a b}"' '1|a b'
|
||||
testcase 'set -- "${e:-a b}"' '1|a b'
|
||||
testcase 'set -- ${e:-\}}' '1|}'
|
||||
|
26
tools/regression/bin/sh/expansion/plus-minus7.0
Normal file
26
tools/regression/bin/sh/expansion/plus-minus7.0
Normal file
@ -0,0 +1,26 @@
|
||||
# $FreeBSD$
|
||||
|
||||
e= s='foo'
|
||||
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 -- ${s+a b}' '2|a|b'
|
||||
testcase 'set -- ${e:-a b}' '2|a|b'
|
||||
|
||||
test "x$failures" = x
|
Loading…
Reference in New Issue
Block a user