From owner-svn-src-stable-8@FreeBSD.ORG Tue Jun 14 20:04:23 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 970E7106566B; Tue, 14 Jun 2011 20:04:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83F5B8FC08; Tue, 14 Jun 2011 20:04:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EK4NDk049677; Tue, 14 Jun 2011 20:04:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EK4N6G049664; Tue, 14 Jun 2011 20:04:23 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106142004.p5EK4N6G049664@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 14 Jun 2011 20:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223096 - in stable/8/tools/regression/bin/sh: builtins execution expansion parameters parser X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 20:04:23 -0000 Author: jilles Date: Tue Jun 14 20:04:23 2011 New Revision: 223096 URL: http://svn.freebsd.org/changeset/base/223096 Log: MFC r221887,r222158,r222379,r222451,r222512,r222661,r222715,r222882: sh: New testcases that already work in stable/8. Added: stable/8/tools/regression/bin/sh/builtins/cd5.0 - copied unchanged from r222379, head/tools/regression/bin/sh/builtins/cd5.0 stable/8/tools/regression/bin/sh/builtins/set1.0 - copied unchanged from r222451, head/tools/regression/bin/sh/builtins/set1.0 stable/8/tools/regression/bin/sh/execution/set-n1.0 - copied unchanged from r222661, head/tools/regression/bin/sh/execution/set-n1.0 stable/8/tools/regression/bin/sh/execution/set-n2.0 - copied unchanged from r222661, head/tools/regression/bin/sh/execution/set-n2.0 stable/8/tools/regression/bin/sh/execution/set-n3.0 - copied unchanged from r222661, head/tools/regression/bin/sh/execution/set-n3.0 stable/8/tools/regression/bin/sh/execution/set-x1.0 - copied unchanged from r222882, head/tools/regression/bin/sh/execution/set-x1.0 stable/8/tools/regression/bin/sh/execution/set-x2.0 - copied unchanged from r222882, head/tools/regression/bin/sh/execution/set-x2.0 stable/8/tools/regression/bin/sh/expansion/heredoc1.0 - copied unchanged from r222715, head/tools/regression/bin/sh/expansion/heredoc1.0 stable/8/tools/regression/bin/sh/parameters/positional1.0 - copied unchanged from r222158, head/tools/regression/bin/sh/parameters/positional1.0 stable/8/tools/regression/bin/sh/parser/func2.0 - copied unchanged from r222512, head/tools/regression/bin/sh/parser/func2.0 stable/8/tools/regression/bin/sh/parser/func3.0 - copied unchanged from r222512, head/tools/regression/bin/sh/parser/func3.0 stable/8/tools/regression/bin/sh/parser/heredoc10.0 - copied unchanged from r221887, head/tools/regression/bin/sh/parser/heredoc10.0 stable/8/tools/regression/bin/sh/parser/heredoc9.0 - copied unchanged from r221887, head/tools/regression/bin/sh/parser/heredoc9.0 Modified: Directory Properties: stable/8/tools/regression/bin/sh/ (props changed) Copied: stable/8/tools/regression/bin/sh/builtins/cd5.0 (from r222379, head/tools/regression/bin/sh/builtins/cd5.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/cd5.0 Tue Jun 14 20:04:23 2011 (r223096, copy of r222379, head/tools/regression/bin/sh/builtins/cd5.0) @@ -0,0 +1,23 @@ +# $FreeBSD$ + +set -e +T=$(mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXX") +trap 'rm -rf "$T"' 0 + +cd -P "$T" +D=$(pwd) + +mkdir a a/1 b b/1 b/2 + +CDPATH=$D/a: +# Basic test. +cd 1 >/dev/null +[ "$(pwd)" = "$D/a/1" ] +# Test that the current directory is not checked before CDPATH. +cd "$D/b" +cd 1 >/dev/null +[ "$(pwd)" = "$D/a/1" ] +# Test not using a CDPATH entry. +cd "$D/b" +cd 2 +[ "$(pwd)" = "$D/b/2" ] Copied: stable/8/tools/regression/bin/sh/builtins/set1.0 (from r222451, head/tools/regression/bin/sh/builtins/set1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/set1.0 Tue Jun 14 20:04:23 2011 (r223096, copy of r222451, head/tools/regression/bin/sh/builtins/set1.0) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +set +C +set +f +set -e + +settings=$(set +o) +set -C +set -f +set +e +case $- in +*C*) ;; +*) echo missing C ;; +esac +case $- in +*f*) ;; +*) echo missing C ;; +esac +case $- in +*e*) echo bad e ;; +esac +eval "$settings" +case $- in +*C*) echo bad C ;; +esac +case $- in +*f*) echo bad f ;; +esac +case $- in +*e*) ;; +*) echo missing e ;; +esac Copied: stable/8/tools/regression/bin/sh/execution/set-n1.0 (from r222661, head/tools/regression/bin/sh/execution/set-n1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/execution/set-n1.0 Tue Jun 14 20:04:23 2011 (r223096, copy of r222661, head/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" ] Copied: stable/8/tools/regression/bin/sh/execution/set-n2.0 (from r222661, head/tools/regression/bin/sh/execution/set-n2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/execution/set-n2.0 Tue Jun 14 20:04:23 2011 (r223096, copy of r222661, head/tools/regression/bin/sh/execution/set-n2.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +$SH -n <<'EOF' +echo bad +EOF Copied: stable/8/tools/regression/bin/sh/execution/set-n3.0 (from r222661, head/tools/regression/bin/sh/execution/set-n3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/execution/set-n3.0 Tue Jun 14 20:04:23 2011 (r223096, copy of r222661, head/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" ] Copied: stable/8/tools/regression/bin/sh/execution/set-x1.0 (from r222882, head/tools/regression/bin/sh/execution/set-x1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/execution/set-x1.0 Tue Jun 14 20:04:23 2011 (r223096, copy of r222882, head/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 Copied: stable/8/tools/regression/bin/sh/execution/set-x2.0 (from r222882, head/tools/regression/bin/sh/execution/set-x2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/execution/set-x2.0 Tue Jun 14 20:04:23 2011 (r223096, copy of r222882, head/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 Copied: stable/8/tools/regression/bin/sh/expansion/heredoc1.0 (from r222715, head/tools/regression/bin/sh/expansion/heredoc1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/heredoc1.0 Tue Jun 14 20:04:23 2011 (r223096, copy of r222715, head/tools/regression/bin/sh/expansion/heredoc1.0) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +f() { return $1; } + +[ `f 42; { cat; } <