From owner-freebsd-bugs@FreeBSD.ORG Sun Jan 13 02:30:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C1F216A420 for ; Sun, 13 Jan 2008 02:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA3A13C448 for ; Sun, 13 Jan 2008 02:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m0D2U0Io044288 for ; Sun, 13 Jan 2008 02:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m0D2U0P7044287; Sun, 13 Jan 2008 02:30:00 GMT (envelope-from gnats) Resent-Date: Sun, 13 Jan 2008 02:30:00 GMT Resent-Message-Id: <200801130230.m0D2U0P7044287@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Giorgos Keramidas Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FF4A16A41A for ; Sun, 13 Jan 2008 02:29:42 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from mx-out-01.forthnet.gr (mx-out.forthnet.gr [193.92.150.104]) by mx1.freebsd.org (Postfix) with ESMTP id D6BBF13C447 for ; Sun, 13 Jan 2008 02:29:41 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from mx-av-04.forthnet.gr (mx-av.forthnet.gr [193.92.150.27]) by mx-out-01.forthnet.gr (8.13.8/8.13.8) with ESMTP id m0D2TeZf011307; Sun, 13 Jan 2008 04:29:40 +0200 Received: from MX-IN-05.forthnet.gr (mx-in-05.forthnet.gr [193.92.150.32]) by mx-av-04.forthnet.gr (8.14.1/8.14.1) with ESMTP id m0D2Tef6027720; Sun, 13 Jan 2008 04:29:40 +0200 Received: from kobe.laptop (ppp43-253.adsl.forthnet.gr [62.1.60.253]) by MX-IN-05.forthnet.gr (8.14.2/8.14.2) with ESMTP id m0D2TYtU007813; Sun, 13 Jan 2008 04:29:35 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.2/8.14.2) with ESMTP id m0D2TYVR002258; Sun, 13 Jan 2008 04:29:34 +0200 (EET) (envelope-from keramida@kobe.laptop) Received: (from keramida@localhost) by kobe.laptop (8.14.2/8.14.2/Submit) id m0D2TYpV002257; Sun, 13 Jan 2008 04:29:34 +0200 (EET) (envelope-from keramida) Message-Id: <200801130229.m0D2TYpV002257@kobe.laptop> Date: Sun, 13 Jan 2008 04:29:34 +0200 (EET) From: Giorgos Keramidas To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Diomidis Spinellis Subject: bin/119614: regression tests for tr(1) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Giorgos Keramidas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2008 02:30:01 -0000 >Number: 119614 >Category: bin >Synopsis: regression tests for tr(1) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jan 13 02:30:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Giorgos Keramidas >Release: FreeBSD 8.0-CURRENT i386 >Organization: >Environment: System: FreeBSD kobe 8.0-CURRENT FreeBSD 8.0-CURRENT #0: \ Tue Jan 8 23:38:14 EET 2008 \ build@kobe:/home/build/obj/home/build/src/sys/KOBE i386 >Description: The attached patch adds a small set of regression tests for tr(1). It is far from a complete set of tests, but we can always expand it (I'm hoping for the help of Diomidis for directions about the best way to do that). >How-To-Repeat: After applying the patch, it should be possible to run: cd /usr/src/tools/regression/usr.bin/tr make >Fix: --- regression-tr.patch begins here --- diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/Makefile --- a/tools/regression/usr.bin/Makefile Sun Jan 13 04:24:27 2008 +0200 +++ b/tools/regression/usr.bin/Makefile Sun Jan 13 04:24:28 2008 +0200 @@ -1,5 +1,16 @@ # $FreeBSD: src/tools/regression/usr.bin/Makefile,v 1.12 2007/06/03 03:29:31 grog Exp $ -SUBDIR= calendar file2c join jot m4 printf sed uudecode uuencode xargs lastcomm +SUBDIR = calendar +SUBDIR+= file2c +SUBDIR+= join +SUBDIR+= jot +SUBDIR+= lastcomm +SUBDIR+= m4 +SUBDIR+= printf +SUBDIR+= sed +SUBDIR+= tr +SUBDIR+= uudecode +SUBDIR+= uuencode +SUBDIR+= xargs .include diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/Makefile Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.00.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.00.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,4 @@ +qui3k 2rown +fox jump54 +ov5r th5 l1zy +4og diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.01.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.01.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the lazy +dog diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.02.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.02.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,4 @@ +quik brown +fox jumpd +ovr th lzy +do diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.03.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.03.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,4 @@ +QUICK BROWN +FOX JUMPED +OVER THE LAZY +DOG diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.04.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.04.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,4 @@ +..... ..... +... ...... +.... ... .... +... diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.05.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.05.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the lazy +dog diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.06.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.06.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,9 @@ +??? bottles of beer on the wall, ??? bottles of beer. +Take one down and pass it around - ?? bottles of beer on the wall. +?? bottles of beer on the wall, ?? bottles of beer. +Take one down and pass it around - ?? bottles of beer on the wall. +... +? bottles of beer on the wall, ? bottles of beer!!! +Take one down and pass it around - ? bottle of beer on the wall. +? bottle of beer on the wall, ? bottle of beer!!! +Take it down and pass it around - NO MORE bottles of beer on the wall!!! diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.07.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.07.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,9 @@ +### ####### ## #### ## ### ####, ### ####### ## ####. +#### ### #### ### #### ## ###### - ## ####### ## #### ## ### ####. +## ####### ## #### ## ### ####, ## ####### ## ####. +#### ### #### ### #### ## ###### - ## ####### ## #### ## ### ####. +... +# ####### ## #### ## ### ####, # ####### ## ####!!! +#### ### #### ### #### ## ###### - # ###### ## #### ## ### ####. +# ###### ## #### ## ### ####, # ###### ## ####!!! +#### ## #### ### #### ## ###### - ## #### ####### ## #### ## ### ####!!! diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.08.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.08.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,9 @@ +100,100. +-99. +99,99. +-98. +... +2,2!!! +-1. +1,1!!! +-!!! diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.09.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.09.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,1 @@ +?# diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.0a.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.0a.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,1 @@ +$?$$$$$$$$ diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.0b.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.0b.out Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,1 @@ +100befbeeea100befbeeaeedadaad99befbeeea99befbeeea99befbeeaeedadaad98befbeeea2befbeeea2befbeeaeedadaad1befbeeea1befbeeea1befbeeaedadaadEbefbeeea diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.in Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the lazy +dog diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.sh Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,20 @@ +# $FreeBSD$ + +echo 1..12 + +REGRESSION_START($1) + +REGRESSION_TEST(`00', `tr abcde 12345 < regress.in') +REGRESSION_TEST(`01', `tr 12345 abcde < regress.in') +REGRESSION_TEST(`02', `tr -d aceg < regress.in') +REGRESSION_TEST(`03', `tr "[[:lower:]]" "[[:upper:]]" < regress.in') +REGRESSION_TEST(`04', `tr "[[:alpha:]]" . < regress.in') +REGRESSION_TEST(`05', `tr "[[:lower:]]" "[[:upper:]]" < regress.in | tr "[[:upper:]]" "[[:lower:]]"') +REGRESSION_TEST(`06', `tr "[[:digit:]]" "?" < regress2.in') +REGRESSION_TEST(`07', `tr "[[:alnum:]]" "#" < regress2.in') +REGRESSION_TEST(`08', `tr "[[:upper:]]" "[[:lower:]]" < regress2.in | tr -d "[^[:alpha:]] "') +REGRESSION_TEST(`09', `printf "\\f\\r\\n" | tr "\\014\\r" "?#"') +REGRESSION_TEST(`0a', `printf "0xdeadbeef\\n" | tr "x[[:xdigit:]]" "?\$"') +REGRESSION_TEST(`0b', `(tr -cd "[[:xdigit:]]" < regress2.in ; echo)') + +REGRESSION_END() diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress.t --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress.t Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +m4 ../regress.m4 regress.sh | sh diff -r cdc776357ea9 -r 5f6d24ce0a4d tools/regression/usr.bin/tr/regress2.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/regress2.in Sun Jan 13 04:24:28 2008 +0200 @@ -0,0 +1,9 @@ +100 bottles of beer on the wall, 100 bottles of beer. +Take one down and pass it around - 99 bottles of beer on the wall. +99 bottles of beer on the wall, 99 bottles of beer. +Take one down and pass it around - 98 bottles of beer on the wall. +... +2 bottles of beer on the wall, 2 bottles of beer!!! +Take one down and pass it around - 1 bottle of beer on the wall. +1 bottle of beer on the wall, 1 bottle of beer!!! +Take it down and pass it around - NO MORE bottles of beer on the wall!!! --- regression-tr.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: