From b76c241652fa695a84e22aa11f21e1a67bedaa3d Mon Sep 17 00:00:00 2001 From: bapt Date: Sat, 2 May 2015 12:08:28 +0000 Subject: Add regression test about reverse line feed to col(1) --- usr.bin/col/Makefile | 6 ++++++ usr.bin/col/tests/Makefile | 11 +++++++++++ usr.bin/col/tests/col.sh | 39 +++++++++++++++++++++++++++++++++++++++ usr.bin/col/tests/rlf.in | 2 ++ usr.bin/col/tests/rlf2.in | 2 ++ 5 files changed, 60 insertions(+) create mode 100644 usr.bin/col/tests/Makefile create mode 100755 usr.bin/col/tests/col.sh create mode 100644 usr.bin/col/tests/rlf.in create mode 100644 usr.bin/col/tests/rlf2.in (limited to 'usr.bin/col') diff --git a/usr.bin/col/Makefile b/usr.bin/col/Makefile index 8e3a959..a162866 100644 --- a/usr.bin/col/Makefile +++ b/usr.bin/col/Makefile @@ -1,6 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= col +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/usr.bin/col/tests/Makefile b/usr.bin/col/tests/Makefile new file mode 100644 index 0000000..43838e9 --- /dev/null +++ b/usr.bin/col/tests/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/col + +ATF_TESTS_SH= col + +FILES= rlf.in \ + rlf2.in +FILESDIR= ${TESTSDIR} + +.include diff --git a/usr.bin/col/tests/col.sh b/usr.bin/col/tests/col.sh new file mode 100755 index 0000000..1730c90 --- /dev/null +++ b/usr.bin/col/tests/col.sh @@ -0,0 +1,39 @@ +# $FreeBSD$ + +atf_test_case rlf + +rlf_head() +{ + atf_set "descr" "testing reverse line feed" +} +rlf_body() +{ + atf_check \ + -o inline:"a b\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/rlf.in + + atf_check \ + -o inline:"a b3\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/rlf2.in + + atf_check \ + -o inline:"a b3\n" \ + -e empty \ + -s exit:0 \ + col -x < $(atf_get_srcdir)/rlf2.in + + atf_check \ + -o inline:"a b3\n" \ + -e empty \ + -s exit:0 \ + col -p < $(atf_get_srcdir)/rlf2.in +} + +atf_init_test_cases() +{ + atf_add_test_case rlf +} diff --git a/usr.bin/col/tests/rlf.in b/usr.bin/col/tests/rlf.in new file mode 100644 index 0000000..57a14e5 --- /dev/null +++ b/usr.bin/col/tests/rlf.in @@ -0,0 +1,2 @@ +a + 7b diff --git a/usr.bin/col/tests/rlf2.in b/usr.bin/col/tests/rlf2.in new file mode 100644 index 0000000..dd46851 --- /dev/null +++ b/usr.bin/col/tests/rlf2.in @@ -0,0 +1,2 @@ +a + 7b -- cgit v1.1