mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04: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
2 changed files with 26 additions and 3 deletions
|
|
@ -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 a new issue