Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2012 23:10:18 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230121 - head/tools/regression/bin/sh/expansion
Message-ID:  <201201142310.q0ENAIaF052835@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Sat Jan 14 23:10:18 2012
New Revision: 230121
URL: http://svn.freebsd.org/changeset/base/230121

Log:
  sh: Add testcases that should not be broken by future optimizations.

Added:
  head/tools/regression/bin/sh/expansion/cmdsubst12.0   (contents, props changed)
  head/tools/regression/bin/sh/expansion/cmdsubst13.0   (contents, props changed)

Added: head/tools/regression/bin/sh/expansion/cmdsubst12.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/cmdsubst12.0	Sat Jan 14 23:10:18 2012	(r230121)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+f() {
+	echo x$(printf foo >&2)y
+}
+[ "$(f 2>&1)" = "fooxy" ]

Added: head/tools/regression/bin/sh/expansion/cmdsubst13.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/cmdsubst13.0	Sat Jan 14 23:10:18 2012	(r230121)
@@ -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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201142310.q0ENAIaF052835>