summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2016-01-07 21:46:07 +0000
committerjilles <jilles@FreeBSD.org>2016-01-07 21:46:07 +0000
commit2d4b37e81d3bbeb199e670441c7587ba87d76042 (patch)
tree05b8b0fa9c7e44f23bab5a7cd7b94a19a882fff5 /bin
parenta32f535abcc78898d1fabfee3ab20ee1cc868a4a (diff)
downloadFreeBSD-src-2d4b37e81d3bbeb199e670441c7587ba87d76042.zip
FreeBSD-src-2d4b37e81d3bbeb199e670441c7587ba87d76042.tar.gz
sh: Add a test for 'cd -'.
Redirect 'cd -' output to /dev/null since POSIX requires it to write the new directory name even if not interactive, but we currently only write it if interactive.
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/tests/builtins/Makefile1
-rw-r--r--bin/sh/tests/builtins/cd9.08
-rw-r--r--bin/sh/tests/builtins/cd9.0.stdout2
3 files changed, 11 insertions, 0 deletions
diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile
index 750e615..11240ca 100644
--- a/bin/sh/tests/builtins/Makefile
+++ b/bin/sh/tests/builtins/Makefile
@@ -48,6 +48,7 @@ FILES+= cd5.0
FILES+= cd6.0
FILES+= cd7.0
FILES+= cd8.0
+FILES+= cd9.0 cd9.0.stdout
FILES+= command1.0
FILES+= command2.0
FILES+= command3.0
diff --git a/bin/sh/tests/builtins/cd9.0 b/bin/sh/tests/builtins/cd9.0
new file mode 100644
index 0000000..78bcdff
--- /dev/null
+++ b/bin/sh/tests/builtins/cd9.0
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+cd /dev
+cd /bin
+cd - >/dev/null
+pwd
+cd - >/dev/null
+pwd
diff --git a/bin/sh/tests/builtins/cd9.0.stdout b/bin/sh/tests/builtins/cd9.0.stdout
new file mode 100644
index 0000000..dac16a7
--- /dev/null
+++ b/bin/sh/tests/builtins/cd9.0.stdout
@@ -0,0 +1,2 @@
+/dev
+/bin
OpenPOWER on IntegriCloud