diff options
author | jilles <jilles@FreeBSD.org> | 2012-01-14 23:10:18 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2012-01-14 23:10:18 +0000 |
commit | f481767a1d2c2a5916d470960fcce84e165c36e2 (patch) | |
tree | fc3ef290b890dd14f852891a9fec1215e3ada50b /tools | |
parent | 413b89a7e9cb148ffb08855ef27c973cfbeeb5c0 (diff) | |
download | FreeBSD-src-f481767a1d2c2a5916d470960fcce84e165c36e2.zip FreeBSD-src-f481767a1d2c2a5916d470960fcce84e165c36e2.tar.gz |
sh: Add testcases that should not be broken by future optimizations.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/bin/sh/expansion/cmdsubst12.0 | 6 | ||||
-rw-r--r-- | tools/regression/bin/sh/expansion/cmdsubst13.0 | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/expansion/cmdsubst12.0 b/tools/regression/bin/sh/expansion/cmdsubst12.0 new file mode 100644 index 0000000..50394db --- /dev/null +++ b/tools/regression/bin/sh/expansion/cmdsubst12.0 @@ -0,0 +1,6 @@ +# $FreeBSD$ + +f() { + echo x$(printf foo >&2)y +} +[ "$(f 2>&1)" = "fooxy" ] diff --git a/tools/regression/bin/sh/expansion/cmdsubst13.0 b/tools/regression/bin/sh/expansion/cmdsubst13.0 new file mode 100644 index 0000000..7fdc5b2 --- /dev/null +++ b/tools/regression/bin/sh/expansion/cmdsubst13.0 @@ -0,0 +1,12 @@ +# $FreeBSD$ + +x=1 y=2 +[ "$( + case $((x+=1)) in + ($((y+=1))) echo bad1 ;; + ($((y-1))) echo $x.$y ;; + ($((y=2))) echo bad2 ;; + (*) echo bad3 ;; + esac +)" = "2.3" ] || echo "Error at $LINENO" +[ "$x.$y" = "1.2" ] || echo "Error at $LINENO" |