Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/bin/cat Add a unit test for PR bin/51250 called se_out...



details:   https://anonhg.NetBSD.org/src/rev/7f347f9c6df6
branches:  trunk
changeset: 345929:7f347f9c6df6
user:      sevan <sevan%NetBSD.org@localhost>
date:      Thu Jun 16 01:04:58 2016 +0000

description:
Add a unit test for PR bin/51250 called se_output. se_output checks the output of cat
when invoked with '-se', to ensure that a '$' is printed on blank lines.

diffstat:

 tests/bin/cat/Makefile        |   4 +++-
 tests/bin/cat/d_se_output.in  |   3 +++
 tests/bin/cat/d_se_output.out |   3 +++
 tests/bin/cat/t_cat.sh        |  14 +++++++++++++-
 4 files changed, 22 insertions(+), 2 deletions(-)

diffs (61 lines):

diff -r 44c51a1851a2 -r 7f347f9c6df6 tests/bin/cat/Makefile
--- a/tests/bin/cat/Makefile    Thu Jun 16 00:52:37 2016 +0000
+++ b/tests/bin/cat/Makefile    Thu Jun 16 01:04:58 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2012/03/27 08:16:33 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2016/06/16 01:04:58 sevan Exp $
 
 .include <bsd.own.mk>
 
@@ -8,5 +8,7 @@
 FILESDIR=      ${TESTSDIR}
 FILES+=                d_align.in
 FILES+=                d_align.out
+FILES+=        d_se_output.in
+FILES+=        d_se_output.out
 
 .include <bsd.test.mk>
diff -r 44c51a1851a2 -r 7f347f9c6df6 tests/bin/cat/d_se_output.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/bin/cat/d_se_output.in      Thu Jun 16 01:04:58 2016 +0000
@@ -0,0 +1,3 @@
+
+Of course it runs NetBSD
+
diff -r 44c51a1851a2 -r 7f347f9c6df6 tests/bin/cat/d_se_output.out
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/bin/cat/d_se_output.out     Thu Jun 16 01:04:58 2016 +0000
@@ -0,0 +1,3 @@
+$
+Of course it runs NetBSD$
+$
diff -r 44c51a1851a2 -r 7f347f9c6df6 tests/bin/cat/t_cat.sh
--- a/tests/bin/cat/t_cat.sh    Thu Jun 16 00:52:37 2016 +0000
+++ b/tests/bin/cat/t_cat.sh    Thu Jun 16 01:04:58 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_cat.sh,v 1.2 2012/03/27 17:57:02 jruoho Exp $
+# $NetBSD: t_cat.sh,v 1.3 2016/06/16 01:04:58 sevan Exp $
 #
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -52,8 +52,20 @@
                -x "cat /some/name/that/does/not/exist"
 }
 
+atf_test_case se_output
+se_output_head() {
+       atf_set "descr" "Test that cat(1) prints a $ sign " \
+                       "on blank lines with options '-se' (PR bin/51250)"
+}
+
+se_output_body() {
+       atf_check -s ignore -o file:$(atf_get_srcdir)/d_se_output.out \
+               -x "cat -se $(atf_get_srcdir)/d_se_output.in"
+}
+
 atf_init_test_cases()
 {
        atf_add_test_case align
        atf_add_test_case nonexistent
+       atf_add_test_case se_output
 }



Home | Main Index | Thread Index | Old Index