Add a new set of regression tests, for the tr(1) utility.
Approved by: das, dds
This commit is contained in:
parent
38281b6601
commit
841cbf48eb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175288
4
tools/regression/usr.bin/tr/Makefile
Normal file
4
tools/regression/usr.bin/tr/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
all:
|
||||
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}
|
4
tools/regression/usr.bin/tr/regress.00.out
Normal file
4
tools/regression/usr.bin/tr/regress.00.out
Normal file
@ -0,0 +1,4 @@
|
||||
qui3k 2rown
|
||||
fox jump54
|
||||
ov5r th5 l1zy
|
||||
4og
|
4
tools/regression/usr.bin/tr/regress.01.out
Normal file
4
tools/regression/usr.bin/tr/regress.01.out
Normal file
@ -0,0 +1,4 @@
|
||||
quick brown
|
||||
fox jumped
|
||||
over the lazy
|
||||
dog
|
4
tools/regression/usr.bin/tr/regress.02.out
Normal file
4
tools/regression/usr.bin/tr/regress.02.out
Normal file
@ -0,0 +1,4 @@
|
||||
quik brown
|
||||
fox jumpd
|
||||
ovr th lzy
|
||||
do
|
4
tools/regression/usr.bin/tr/regress.03.out
Normal file
4
tools/regression/usr.bin/tr/regress.03.out
Normal file
@ -0,0 +1,4 @@
|
||||
QUICK BROWN
|
||||
FOX JUMPED
|
||||
OVER THE LAZY
|
||||
DOG
|
4
tools/regression/usr.bin/tr/regress.04.out
Normal file
4
tools/regression/usr.bin/tr/regress.04.out
Normal file
@ -0,0 +1,4 @@
|
||||
..... .....
|
||||
... ......
|
||||
.... ... ....
|
||||
...
|
4
tools/regression/usr.bin/tr/regress.05.out
Normal file
4
tools/regression/usr.bin/tr/regress.05.out
Normal file
@ -0,0 +1,4 @@
|
||||
quick brown
|
||||
fox jumped
|
||||
over the lazy
|
||||
dog
|
9
tools/regression/usr.bin/tr/regress.06.out
Normal file
9
tools/regression/usr.bin/tr/regress.06.out
Normal 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!!!
|
9
tools/regression/usr.bin/tr/regress.07.out
Normal file
9
tools/regression/usr.bin/tr/regress.07.out
Normal file
@ -0,0 +1,9 @@
|
||||
### ####### ## #### ## ### ####, ### ####### ## ####.
|
||||
#### ### #### ### #### ## ###### - ## ####### ## #### ## ### ####.
|
||||
## ####### ## #### ## ### ####, ## ####### ## ####.
|
||||
#### ### #### ### #### ## ###### - ## ####### ## #### ## ### ####.
|
||||
...
|
||||
# ####### ## #### ## ### ####, # ####### ## ####!!!
|
||||
#### ### #### ### #### ## ###### - # ###### ## #### ## ### ####.
|
||||
# ###### ## #### ## ### ####, # ###### ## ####!!!
|
||||
#### ## #### ### #### ## ###### - ## #### ####### ## #### ## ### ####!!!
|
9
tools/regression/usr.bin/tr/regress.08.out
Normal file
9
tools/regression/usr.bin/tr/regress.08.out
Normal file
@ -0,0 +1,9 @@
|
||||
100,100.
|
||||
-99.
|
||||
99,99.
|
||||
-98.
|
||||
...
|
||||
2,2!!!
|
||||
-1.
|
||||
1,1!!!
|
||||
-!!!
|
1
tools/regression/usr.bin/tr/regress.09.out
Normal file
1
tools/regression/usr.bin/tr/regress.09.out
Normal file
@ -0,0 +1 @@
|
||||
?#
|
1
tools/regression/usr.bin/tr/regress.0a.out
Normal file
1
tools/regression/usr.bin/tr/regress.0a.out
Normal file
@ -0,0 +1 @@
|
||||
$?$$$$$$$$
|
1
tools/regression/usr.bin/tr/regress.0b.out
Normal file
1
tools/regression/usr.bin/tr/regress.0b.out
Normal file
@ -0,0 +1 @@
|
||||
100befbeeea100befbeeaeedadaad99befbeeea99befbeeea99befbeeaeedadaad98befbeeea2befbeeea2befbeeaeedadaad1befbeeea1befbeeea1befbeeaedadaadEbefbeeea
|
4
tools/regression/usr.bin/tr/regress.in
Normal file
4
tools/regression/usr.bin/tr/regress.in
Normal file
@ -0,0 +1,4 @@
|
||||
quick brown
|
||||
fox jumped
|
||||
over the lazy
|
||||
dog
|
20
tools/regression/usr.bin/tr/regress.sh
Normal file
20
tools/regression/usr.bin/tr/regress.sh
Normal 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()
|
6
tools/regression/usr.bin/tr/regress.t
Normal file
6
tools/regression/usr.bin/tr/regress.t
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
cd `dirname $0`
|
||||
|
||||
m4 ../regress.m4 regress.sh | sh
|
9
tools/regression/usr.bin/tr/regress2.in
Normal file
9
tools/regression/usr.bin/tr/regress2.in
Normal 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!!!
|
Loading…
Reference in New Issue
Block a user