From 0e50eefbd53961b0c25620cf7d09deaa02adb752 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Thu, 7 Jan 2016 21:46:07 +0000 Subject: [PATCH] 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. --- bin/sh/tests/builtins/Makefile | 1 + bin/sh/tests/builtins/cd9.0 | 8 ++++++++ bin/sh/tests/builtins/cd9.0.stdout | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 bin/sh/tests/builtins/cd9.0 create mode 100644 bin/sh/tests/builtins/cd9.0.stdout diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile index 750e61569de0..11240ca7dda8 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 000000000000..78bcdff9a933 --- /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 000000000000..dac16a768d5e --- /dev/null +++ b/bin/sh/tests/builtins/cd9.0.stdout @@ -0,0 +1,2 @@ +/dev +/bin