From 7cdc70f201373509a1a79fcef4521a6ea6ca7434 Mon Sep 17 00:00:00 2001 From: Stefan Farfeleder Date: Sun, 24 Feb 2008 16:52:02 +0000 Subject: [PATCH] Add a regression test for cd.c's revision 1.35. --- tools/regression/bin/sh/builtins/cd1.0 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tools/regression/bin/sh/builtins/cd1.0 diff --git a/tools/regression/bin/sh/builtins/cd1.0 b/tools/regression/bin/sh/builtins/cd1.0 new file mode 100644 index 000000000000..52970232bf41 --- /dev/null +++ b/tools/regression/bin/sh/builtins/cd1.0 @@ -0,0 +1,17 @@ +# $FreeBSD$ +set -e + +PDIR=${TMPDIR:-/tmp} +cd ${PDIR} +TMPDIR=$(mktemp -d sh-test.XXXXXX) +chmod 0 ${TMPDIR} + +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 755 ${TMPDIR} +rmdir ${TMPDIR}