From owner-svn-src-head@freebsd.org Tue Jun 6 21:03:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D856ABF5041; Tue, 6 Jun 2017 21:03:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2E407B097; Tue, 6 Jun 2017 21:03:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v56L3hmp004045; Tue, 6 Jun 2017 21:03:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v56L3h3P004039; Tue, 6 Jun 2017 21:03:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706062103.v56L3h3P004039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 6 Jun 2017 21:03:43 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jun 2017 21:03:44 -0000 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 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 @@ + + +á 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 +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 }