From owner-freebsd-bugs@FreeBSD.ORG Fri Apr 6 01:30:05 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18F5516A412 for ; Fri, 6 Apr 2007 01:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 518A613C48A for ; Fri, 6 Apr 2007 01:30:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l361U4YS074078 for ; Fri, 6 Apr 2007 01:30:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l361U4lY074077; Fri, 6 Apr 2007 01:30:04 GMT (envelope-from gnats) Resent-Date: Fri, 6 Apr 2007 01:30:04 GMT Resent-Message-Id: <200704060130.l361U4lY074077@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 [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DC7B16A401 for ; Fri, 6 Apr 2007 01:20:36 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 9400913C455 for ; Fri, 6 Apr 2007 01:20:35 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (dialup40.ach.sch.gr [81.186.70.40]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-3) with ESMTP id l3618dOC004104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 6 Apr 2007 04:08:47 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.13.8/8.13.8) with ESMTP id l3618U0u001573 for ; Fri, 6 Apr 2007 04:08:32 +0300 (EEST) (envelope-from keramida@kobe.laptop) Received: (from keramida@localhost) by kobe.laptop (8.13.8/8.13.8/Submit) id l3618UAZ001572; Fri, 6 Apr 2007 04:08:30 +0300 (EEST) (envelope-from keramida) Message-Id: <200704060108.l3618UAZ001572@kobe.laptop> Date: Fri, 6 Apr 2007 04:08:30 +0300 (EEST) From: Giorgos Keramidas To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/111297: adding some regression tests for usr.bin/tr 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: Fri, 06 Apr 2007 01:30:05 -0000 >Number: 111297 >Category: bin >Synopsis: adding some regression tests for usr.bin/tr >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: Fri Apr 06 01:30:03 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Giorgos Keramidas >Release: FreeBSD 7.0-CURRENT i386 >Organization: >Environment: System: FreeBSD kobe 7.0-CURRENT FreeBSD 7.0-CURRENT #2: Fri Apr 6 03:52:16 EEST 2007 build@kobe:/home/build/obj/home/build/src/sys/GENERIC i386 >Description: The attached patch adds some regression tests for tr(1). They're not very extensive, and they certainly don't cover all the possible corner cases yet, but they're a start :) >How-To-Repeat: >Fix: The patch can be applied with `cd src; gpatch -p1 < patchfile'. --- tr-regression.diff begins here --- diff -r be1a46e78c73 tools/regression/usr.bin/Makefile --- a/tools/regression/usr.bin/Makefile Thu Apr 05 21:03:04 2007 +0000 +++ b/tools/regression/usr.bin/Makefile Fri Apr 06 04:04:43 2007 +0300 @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= file2c join jot m4 printf sed uudecode uuencode xargs +SUBDIR= file2c join jot m4 printf sed tr uudecode uuencode xargs .include diff -r be1a46e78c73 tools/regression/usr.bin/tr/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/regression/usr.bin/tr/Makefile Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,4 @@ +qui3k 2rown +fox jump54 +ov5r th5 l1zy +4og diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the lazy +dog diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,4 @@ +quik brown +fox jumpd +ovr th lzy +do diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,4 @@ +QUICK BROWN +FOX JUMPED +OVER THE LAZY +DOG diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,4 @@ +..... ..... +... ...... +.... ... .... +... diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the lazy +dog diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -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 be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,9 @@ +### ####### ## #### ## ### ####, ### ####### ## ####. +#### ### #### ### #### ## ###### - ## ####### ## #### ## ### ####. +## ####### ## #### ## ### ####, ## ####### ## ####. +#### ### #### ### #### ## ###### - ## ####### ## #### ## ### ####. +... +# ####### ## #### ## ### ####, # ####### ## ####!!! +#### ### #### ### #### ## ###### - # ###### ## #### ## ### ####. +# ###### ## #### ## ### ####, # ###### ## ####!!! +#### ## #### ### #### ## ###### - ## #### ####### ## #### ## ### ####!!! diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,9 @@ +100,100. +-99. +99,99. +-98. +... +2,2!!! +-1. +1,1!!! +-!!! diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,1 @@ +?# diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,1 @@ +$?$$$$$$$$ diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,1 @@ +100befbeeea100befbeeaeedadaad99befbeeea99befbeeea99befbeeaeedadaad98befbeeea2befbeeea2befbeeaeedadaad1befbeeea1befbeeea1befbeeaedadaadEbefbeeea diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the lazy +dog diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -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 be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +m4 ../regress.m4 regress.sh | sh diff -r be1a46e78c73 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 Fri Apr 06 04:04:43 2007 +0300 @@ -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!!! --- tr-regression.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: