Date: Fri, 21 May 2010 16:25:16 +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-7@freebsd.org Subject: svn commit: r208386 - stable/7/tools/regression/bin/sh/builtins Message-ID: <201005211625.o4LGPGlJ068034@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: stefanf Date: Fri May 21 16:25:16 2010 New Revision: 208386 URL: http://svn.freebsd.org/changeset/base/208386 Log: Merge r199628 and r199632: Tests for the cd command. Added: stable/7/tools/regression/bin/sh/builtins/cd1.0 - copied, changed from r176522, head/tools/regression/bin/sh/builtins/cd1.0 stable/7/tools/regression/bin/sh/builtins/cd2.0 - copied unchanged from r199632, head/tools/regression/bin/sh/builtins/cd2.0 Modified: Directory Properties: stable/7/tools/regression/bin/sh/ (props changed) Copied and modified: stable/7/tools/regression/bin/sh/builtins/cd1.0 (from r176522, head/tools/regression/bin/sh/builtins/cd1.0) ============================================================================== --- head/tools/regression/bin/sh/builtins/cd1.0 Sun Feb 24 16:52:02 2008 (r176522, copy source) +++ stable/7/tools/regression/bin/sh/builtins/cd1.0 Fri May 21 16:25:16 2010 (r208386) @@ -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/7/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/7/tools/regression/bin/sh/builtins/cd2.0 Fri May 21 16:25:16 2010 (r208386, 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?201005211625.o4LGPGlJ068034>