Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jun 2017 21:03:43 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319634 - in head: bin/cat/tests contrib/netbsd-tests/bin/cat
Message-ID:  <201706062103.v56L3h3P004039@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Tue Jun  6 21:03:43 2017
New Revision: 319634
URL: https://svnweb.freebsd.org/changeset/base/319634

Log:
  Add additional testcases for cat(1)
  
  Verify the following additional cases:
  - -s (in isolation, in addition to the -se testcase obtained via the
        NetBSD test).
  - -vt
  
  Submitted by:	shivansh
  Reviewed by:	asomers (earlier diff), ngie
  MFC after:	1 month
  Sponsored by:	Google, Inc (GSoC 2017)
  Differential Revision:	D11020

Added:
  head/contrib/netbsd-tests/bin/cat/d_s_output.in   (contents, props changed)
  head/contrib/netbsd-tests/bin/cat/d_s_output.out
  head/contrib/netbsd-tests/bin/cat/d_vt_output.in   (contents, props changed)
  head/contrib/netbsd-tests/bin/cat/d_vt_output.out
Modified:
  head/bin/cat/tests/Makefile
  head/contrib/netbsd-tests/bin/cat/t_cat.sh

Modified: head/bin/cat/tests/Makefile
==============================================================================
--- head/bin/cat/tests/Makefile	Tue Jun  6 19:21:35 2017	(r319633)
+++ head/bin/cat/tests/Makefile	Tue Jun  6 21:03:43 2017	(r319634)
@@ -8,6 +8,10 @@ ${PACKAGE}FILES+=		d_align.in
 ${PACKAGE}FILES+=		d_align.out
 ${PACKAGE}FILES+=		d_se_output.in
 ${PACKAGE}FILES+=		d_se_output.out
+${PACKAGE}FILES+=		d_s_output.in
+${PACKAGE}FILES+=		d_s_output.out
+${PACKAGE}FILES+=		d_vt_output.in
+${PACKAGE}FILES+=		d_vt_output.out
 
 .include <netbsd-tests.test.mk>
 

Added: head/contrib/netbsd-tests/bin/cat/d_s_output.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/netbsd-tests/bin/cat/d_s_output.in	Tue Jun  6 21:03:43 2017	(r319634)
@@ -0,0 +1,6 @@
+a b c
+
+
+1 2 3
+
+x y z

Added: head/contrib/netbsd-tests/bin/cat/d_s_output.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/netbsd-tests/bin/cat/d_s_output.out	Tue Jun  6 21:03:43 2017	(r319634)
@@ -0,0 +1,5 @@
+a b c
+
+1 2 3
+
+x y z

Added: head/contrib/netbsd-tests/bin/cat/d_vt_output.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/netbsd-tests/bin/cat/d_vt_output.in	Tue Jun  6 21:03:43 2017	(r319634)
@@ -0,0 +1,3 @@
+	
+<BS>
+á

Added: head/contrib/netbsd-tests/bin/cat/d_vt_output.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/netbsd-tests/bin/cat/d_vt_output.out	Tue Jun  6 21:03:43 2017	(r319634)
@@ -0,0 +1,3 @@
+^I
+^X<BS>
+M-a

Modified: head/contrib/netbsd-tests/bin/cat/t_cat.sh
==============================================================================
--- head/contrib/netbsd-tests/bin/cat/t_cat.sh	Tue Jun  6 19:21:35 2017	(r319633)
+++ head/contrib/netbsd-tests/bin/cat/t_cat.sh	Tue Jun  6 21:03:43 2017	(r319634)
@@ -63,9 +63,50 @@ se_output_body() {
 		-x "cat -se $(atf_get_srcdir)/d_se_output.in"
 }
 
+# Begin FreeBSD
+atf_test_case s_output
+s_output_head() {
+	atf_set "descr" "Test that cat(1) squeezes multiple adjacent " \
+			"empty lines producing a single spaced output with option '-s'"
+}
+
+s_output_body() {
+	atf_check -s ignore -o file:$(atf_get_srcdir)/d_s_output.out \
+		cat -s $(atf_get_srcdir)/d_s_output.in
+}
+
+atf_test_case e_output
+e_output_head() {
+	atf_set "descr" "Test that cat(1) prints a $ sign " \
+			"on blank lines with option '-e'"
+}
+
+e_output_body() {
+	atf_check -s ignore -o file:$(atf_get_srcdir)/d_se_output.out \
+		cat -e $(atf_get_srcdir)/d_se_output.in
+}
+
+atf_test_case vt_output
+vt_output_head() {
+	atf_set "descr" "Test that cat(1) displays non-printing characters, " \
+			"namely control characters, tab character and meta-characters " \
+			"using options '-vt'"
+}
+
+vt_output_body() {
+	atf_check -s ignore -o file:$(atf_get_srcdir)/d_vt_output.out \
+		cat -vt $(atf_get_srcdir)/d_vt_output.in
+}
+# End FreeBSD
+
 atf_init_test_cases()
 {
 	atf_add_test_case align
 	atf_add_test_case nonexistent
 	atf_add_test_case se_output
+# Begin FreeBSD
+	atf_add_test_case s_output
+	atf_add_test_case e_output
+	atf_add_test_case vt_output
+# End FreeBSD
 }



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