diff options
author | stefanf <stefanf@FreeBSD.org> | 2008-02-24 16:52:02 +0000 |
---|---|---|
committer | stefanf <stefanf@FreeBSD.org> | 2008-02-24 16:52:02 +0000 |
commit | 966480ec8bbc78663e34521df7ca87822b3c2533 (patch) | |
tree | b9bbd2bd0b39085a80458a99fe4f62354fab862a | |
parent | fe9202bf0f56d3e502455e35dcc4eb1a964fba78 (diff) | |
download | FreeBSD-src-966480ec8bbc78663e34521df7ca87822b3c2533.zip FreeBSD-src-966480ec8bbc78663e34521df7ca87822b3c2533.tar.gz |
Add a regression test for cd.c's revision 1.35.
-rw-r--r-- | tools/regression/bin/sh/builtins/cd1.0 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/cd1.0 b/tools/regression/bin/sh/builtins/cd1.0 new file mode 100644 index 0000000..5297023 --- /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} |