sh: Add simple tests for set -x and PS4.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 25 Dec 2011 17:54:50 +0000 (09:54 -0800)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 25 Dec 2011 17:54:50 +0000 (09:54 -0800)
Obtained-from:  FreeBSD 222882

tools/regression/bin/sh/execution/set-x1.0 [new file with mode: 0644]
tools/regression/bin/sh/execution/set-x2.0 [new file with mode: 0644]

diff --git a/tools/regression/bin/sh/execution/set-x1.0 b/tools/regression/bin/sh/execution/set-x1.0
new file mode 100644 (file)
index 0000000..87a5947
--- /dev/null
@@ -0,0 +1,8 @@
+# $FreeBSD: src/tools/regression/bin/sh/execution/set-x1.0,v 1.1 2011/06/08 21:58:19 jilles Exp $
+
+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 (file)
index 0000000..e8818ca
--- /dev/null
@@ -0,0 +1,9 @@
+# $FreeBSD: src/tools/regression/bin/sh/execution/set-x2.0,v 1.1 2011/06/08 21:58:19 jilles Exp $
+
+key='must contain this'
+PS4="$key+ "
+{ r=`set -x; { :; } 2>&1 >/dev/null`; } 2>/dev/null
+case $r in
+*"$key"*) true ;;
+*) false ;;
+esac