From 3eee62c606c3f17de8a9f2c2b356731aae0e2560 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Fri, 3 Jun 2011 21:17:42 +0000 Subject: [PATCH] sh: Add tests for -n flag. These already pass. --- tools/regression/bin/sh/execution/set-n1.0 | 7 +++++++ tools/regression/bin/sh/execution/set-n2.0 | 5 +++++ tools/regression/bin/sh/execution/set-n3.0 | 4 ++++ 3 files changed, 16 insertions(+) create mode 100644 tools/regression/bin/sh/execution/set-n1.0 create mode 100644 tools/regression/bin/sh/execution/set-n2.0 create mode 100644 tools/regression/bin/sh/execution/set-n3.0 diff --git a/tools/regression/bin/sh/execution/set-n1.0 b/tools/regression/bin/sh/execution/set-n1.0 new file mode 100644 index 000000000000..14c9b9396ada --- /dev/null +++ b/tools/regression/bin/sh/execution/set-n1.0 @@ -0,0 +1,7 @@ +# $FreeBSD$ + +v=$( ($SH -n <<'EOF' +for +EOF +) 2>&1 >/dev/null) +[ $? -ne 0 ] && [ -n "$v" ] diff --git a/tools/regression/bin/sh/execution/set-n2.0 b/tools/regression/bin/sh/execution/set-n2.0 new file mode 100644 index 000000000000..c7f31629f474 --- /dev/null +++ b/tools/regression/bin/sh/execution/set-n2.0 @@ -0,0 +1,5 @@ +# $FreeBSD$ + +$SH -n <<'EOF' +echo bad +EOF diff --git a/tools/regression/bin/sh/execution/set-n3.0 b/tools/regression/bin/sh/execution/set-n3.0 new file mode 100644 index 000000000000..24a9159fdeb9 --- /dev/null +++ b/tools/regression/bin/sh/execution/set-n3.0 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +v=$( ($SH -nc 'for') 2>&1 >/dev/null) +[ $? -ne 0 ] && [ -n "$v" ]