Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Oct 2015 08:33:07 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r288481 - user/ngie/more-tests/bin/ls/tests
Message-ID:  <201510020833.t928X7e3083167@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Fri Oct  2 08:33:06 2015
New Revision: 288481
URL: https://svnweb.freebsd.org/changeset/base/288481

Log:
  Add a testcase for ls -p

Modified:
  user/ngie/more-tests/bin/ls/tests/ls_tests.sh

Modified: user/ngie/more-tests/bin/ls/tests/ls_tests.sh
==============================================================================
--- user/ngie/more-tests/bin/ls/tests/ls_tests.sh	Fri Oct  2 08:13:45 2015	(r288480)
+++ user/ngie/more-tests/bin/ls/tests/ls_tests.sh	Fri Oct  2 08:33:06 2015	(r288481)
@@ -285,6 +285,26 @@ lcomma_flag_body()
 	    env LC_ALL=en_US.ISO8859-1 ls -l, i
 }
 
+p_flag_head()
+{
+	atf_set "descr" "Verify that the output from ls -p prints out '/' after directories"
+}
+
+p_flag_body()
+{
+	create_test_inputs
+
+	for path in $(find -L .); do
+		suffix=
+		# If path is not a symlink and is a directory, then the suffix
+		# must be "/".
+		if [ ! -L "${path}" -a -d "$path" ]; then
+			suffix=/
+		fi
+		atf_check -e empty -o match:"$path${suffix}" ls -dp $path
+	done
+}
+
 q_flag_and_w_flag_head()
 {
 	atf_set "descr" "Verify that the output from ls -q prints out '?' for ESC and ls -w prints out the escape character"
@@ -479,7 +499,7 @@ atf_init_test_cases()
 	#atf_add_test_case m_flag
 	#atf_add_test_case n_flag
 	#atf_add_test_case o_flag
-	#atf_add_test_case p_flag
+	atf_add_test_case p_flag
 	atf_add_test_case q_flag_and_w_flag
 	#atf_add_test_case r_flag
 	atf_add_test_case s_flag



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510020833.t928X7e3083167>