diff options
author | emaste <emaste@FreeBSD.org> | 2010-12-27 15:57:41 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2010-12-27 15:57:41 +0000 |
commit | 081f34e7e942288fcb82cab6b34cd881c41b6a28 (patch) | |
tree | 238ab560cb5f0d1fd5a947ef596e6e4dec9366d3 /tools/regression | |
parent | 220cb40cba5e953a650c8dfd0ac2935fd7d27244 (diff) | |
download | FreeBSD-src-081f34e7e942288fcb82cab6b34cd881c41b6a28.zip FreeBSD-src-081f34e7e942288fcb82cab6b34cd881c41b6a28.tar.gz |
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
Diffstat (limited to 'tools/regression')
-rw-r--r-- | tools/regression/bin/sh/expansion/plus-minus1.0 | 3 | ||||
-rw-r--r-- | tools/regression/bin/sh/expansion/plus-minus7.0 | 26 |
2 files changed, 26 insertions, 3 deletions
diff --git a/tools/regression/bin/sh/expansion/plus-minus1.0 b/tools/regression/bin/sh/expansion/plus-minus1.0 index 97e2d3c..9a6a53a 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 0000000..9e81f58 --- /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 |