Add a new set of regression tests, for the tr(1) utility.

Approved by:    das, dds
This commit is contained in:
keramida 2008-01-13 08:33:20 +00:00
parent 4cd8e29851
commit fb6f1f0603
17 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,4 @@
# $FreeBSD$
all:
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}

View File

@ -0,0 +1,4 @@
qui3k 2rown
fox jump54
ov5r th5 l1zy
4og

View File

@ -0,0 +1,4 @@
quick brown
fox jumped
over the lazy
dog

View File

@ -0,0 +1,4 @@
quik brown
fox jumpd
ovr th lzy
do

View File

@ -0,0 +1,4 @@
QUICK BROWN
FOX JUMPED
OVER THE LAZY
DOG

View File

@ -0,0 +1,4 @@
..... .....
... ......
.... ... ....
...

View File

@ -0,0 +1,4 @@
quick brown
fox jumped
over the lazy
dog

View File

@ -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!!!

View File

@ -0,0 +1,9 @@
### ####### ## #### ## ### ####, ### ####### ## ####.
#### ### #### ### #### ## ###### - ## ####### ## #### ## ### ####.
## ####### ## #### ## ### ####, ## ####### ## ####.
#### ### #### ### #### ## ###### - ## ####### ## #### ## ### ####.
...
# ####### ## #### ## ### ####, # ####### ## ####!!!
#### ### #### ### #### ## ###### - # ###### ## #### ## ### ####.
# ###### ## #### ## ### ####, # ###### ## ####!!!
#### ## #### ### #### ## ###### - ## #### ####### ## #### ## ### ####!!!

View File

@ -0,0 +1,9 @@
100,100.
-99.
99,99.
-98.
...
2,2!!!
-1.
1,1!!!
-!!!

View File

@ -0,0 +1 @@
?#

View File

@ -0,0 +1 @@
$?$$$$$$$$

View File

@ -0,0 +1 @@
100befbeeea100befbeeaeedadaad99befbeeea99befbeeea99befbeeaeedadaad98befbeeea2befbeeea2befbeeaeedadaad1befbeeea1befbeeea1befbeeaedadaadEbefbeeea

View File

@ -0,0 +1,4 @@
quick brown
fox jumped
over the lazy
dog

View File

@ -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()

View File

@ -0,0 +1,6 @@
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
m4 ../regress.m4 regress.sh | sh

View File

@ -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!!!