From f8e809686a837c2cd6d452efb8f59cc57ca73db1 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Mon, 27 Dec 2010 15:57:41 +0000 Subject: [PATCH] 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 --- .../regression/bin/sh/expansion/plus-minus1.0 | 3 --- .../regression/bin/sh/expansion/plus-minus7.0 | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 tools/regression/bin/sh/expansion/plus-minus7.0 diff --git a/tools/regression/bin/sh/expansion/plus-minus1.0 b/tools/regression/bin/sh/expansion/plus-minus1.0 index 97e2d3c1e4e..9a6a53a2414 100644 --- a/tools/regression/bin/sh/expansion/plus-minus1.0 +++ b/tools/regression/bin/sh/expansion/plus-minus1.0 @@ -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|}' diff --git a/tools/regression/bin/sh/expansion/plus-minus7.0 b/tools/regression/bin/sh/expansion/plus-minus7.0 new file mode 100644 index 00000000000..9e81f58a0a9 --- /dev/null +++ b/tools/regression/bin/sh/expansion/plus-minus7.0 @@ -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