Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 May 2010 16:01:57 +0000 (UTC)
From:      Stefan Farfeleder <stefanf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r208380 - stable/8/tools/regression/bin/sh/builtins
Message-ID:  <201005211601.o4LG1vB6062597@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: stefanf
Date: Fri May 21 16:01:57 2010
New Revision: 208380
URL: http://svn.freebsd.org/changeset/base/208380

Log:
  Merge r199628 and r199632: Tests for the cd command.

Added:
  stable/8/tools/regression/bin/sh/builtins/cd2.0
     - copied unchanged from r199632, head/tools/regression/bin/sh/builtins/cd2.0
Modified:
  stable/8/tools/regression/bin/sh/builtins/cd1.0
Directory Properties:
  stable/8/tools/regression/bin/sh/   (props changed)

Modified: stable/8/tools/regression/bin/sh/builtins/cd1.0
==============================================================================
--- stable/8/tools/regression/bin/sh/builtins/cd1.0	Fri May 21 15:57:24 2010	(r208379)
+++ stable/8/tools/regression/bin/sh/builtins/cd1.0	Fri May 21 16:01:57 2010	(r208380)
@@ -1,17 +1,27 @@
 # $FreeBSD$
 set -e
 
-PDIR=${TMPDIR:-/tmp}
-cd ${PDIR}
-TMPDIR=$(mktemp -d sh-test.XXXXXX)
-chmod 0 ${TMPDIR}
+P=${TMPDIR:-/tmp}
+cd $P
+T=$(mktemp -d sh-test.XXXXXX)
 
-cd -L ${TMPDIR} 2>/dev/null && exit 1
-[ "${PWD}" = "${PDIR}" ]
-[ "$(pwd)" = "${PDIR}" ]
-cd -P ${TMPDIR} 2>/dev/null && exit 1
-[ "${PWD}" = "${PDIR}" ]
-[ "$(pwd)" = "${PDIR}" ]
+chmod 0 $T
+cd -L $T 2>/dev/null && exit 1
+[ "$PWD" = "$P" ]
+[ "$(pwd)" = "$P" ]
+cd -P $T 2>/dev/null && exit 1
+[ "$PWD" = "$P" ]
+[ "$(pwd)" = "$P" ]
 
-chmod 755 ${TMPDIR}
-rmdir ${TMPDIR}
+chmod 755 $T
+cd $T
+mkdir -p 1/2/3
+ln -s 1/2 link1
+ln -s 2/3 1/link2
+(cd -L 1/../1 && [ "$(pwd -L)" = "$P/$T/1" ])
+(cd -L link1 && [ "$(pwd -L)" = "$P/$T/link1" ])
+(cd -L link1 && [ "$(pwd -P)" = "$P/$T/1/2" ])
+(cd -P link1 && [ "$(pwd -L)" = "$P/$T/1/2" ])
+(cd -P link1 && [ "$(pwd -P)" = "$P/$T/1/2" ])
+
+rm -rf ${P}/${T}

Copied: stable/8/tools/regression/bin/sh/builtins/cd2.0 (from r199632, head/tools/regression/bin/sh/builtins/cd2.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/builtins/cd2.0	Fri May 21 16:01:57 2010	(r208380, copy of r199632, head/tools/regression/bin/sh/builtins/cd2.0)
@@ -0,0 +1,15 @@
+# $FreeBSD$
+set -e
+
+T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
+cd $T
+D=$T
+for i in 0 1 2 3 4 5 6 7 8 9; do
+	for j in 0 1 2 3 4 5 6 7 8 9; do
+		mkdir veryverylongdirectoryname
+		cd veryverylongdirectoryname
+		D=$D/veryverylongdirectoryname
+	done
+done
+[ $(pwd | wc -c) -eq $((${#D} + 1)) ] # +\n
+rm -rf ${T}



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