summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-02-17 22:25:22 +0000
committerjilles <jilles@FreeBSD.org>2010-02-17 22:25:22 +0000
commitc8c69261054b9abcb7dc56414c16a0eb5bf00b92 (patch)
tree47ae0d3f4da3aeb9a9ab5e0b29f40c81e4743011 /tools
parent8e6f78bc9798188277e078a9762ed60eaf865b55 (diff)
downloadFreeBSD-src-c8c69261054b9abcb7dc56414c16a0eb5bf00b92.zip
FreeBSD-src-c8c69261054b9abcb7dc56414c16a0eb5bf00b92.tar.gz
sh: arith: Add a test for a bug in the dash arith code,
which I plan to import at some point. Our current code handles it fine and it should stay that way.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/expansion/arith3.014
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/expansion/arith3.0 b/tools/regression/bin/sh/expansion/arith3.0
new file mode 100644
index 0000000..b69159d
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/arith3.0
@@ -0,0 +1,14 @@
+# $FreeBSD$
+
+failures=0
+
+check() {
+ if [ $(($1)) != $2 ]; then
+ failures=$((failures+1))
+ echo "For $1, expected $2 actual $(($1))"
+ fi
+}
+
+check "1 << 1 + 1 | 1" 5
+
+exit $((failures != 0))
OpenPOWER on IntegriCloud