summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-06-08 21:58:19 +0000
committerjilles <jilles@FreeBSD.org>2011-06-08 21:58:19 +0000
commite404c4690a54f152f4ca8b5c20b860bedcee74b6 (patch)
treef0f5626d9881fdba4973448ef4cfd98263e3c78c
parent16e8233bf4753aa48ecfc255622de3f2ef316242 (diff)
downloadFreeBSD-src-e404c4690a54f152f4ca8b5c20b860bedcee74b6.zip
FreeBSD-src-e404c4690a54f152f4ca8b5c20b860bedcee74b6.tar.gz
sh: Add simple tests for set -x and PS4.
-rw-r--r--tools/regression/bin/sh/execution/set-x1.08
-rw-r--r--tools/regression/bin/sh/execution/set-x2.09
2 files changed, 17 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/execution/set-x1.0 b/tools/regression/bin/sh/execution/set-x1.0
new file mode 100644
index 0000000..7fe1dbf
--- /dev/null
+++ b/tools/regression/bin/sh/execution/set-x1.0
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+key='must_contain_this'
+{ r=`set -x; { : "$key"; } 2>&1 >/dev/null`; } 2>/dev/null
+case $r in
+*"$key"*) true ;;
+*) false ;;
+esac
diff --git a/tools/regression/bin/sh/execution/set-x2.0 b/tools/regression/bin/sh/execution/set-x2.0
new file mode 100644
index 0000000..56d54e3
--- /dev/null
+++ b/tools/regression/bin/sh/execution/set-x2.0
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+key='must contain this'
+PS4="$key+ "
+{ r=`set -x; { :; } 2>&1 >/dev/null`; } 2>/dev/null
+case $r in
+*"$key"*) true ;;
+*) false ;;
+esac
OpenPOWER on IntegriCloud