diff options
author | jmmv <jmmv@FreeBSD.org> | 2014-03-16 08:04:06 +0000 |
---|---|---|
committer | jmmv <jmmv@FreeBSD.org> | 2014-03-16 08:04:06 +0000 |
commit | 41a8d8c29552ddd9098cfb09a71927f503a28371 (patch) | |
tree | a434fba265da51ef79b1cfc4461e1080dbe53e90 /usr.bin/tr/tests | |
parent | b2e51e38a88412c17ce1160c247a6d673c0b2147 (diff) | |
download | FreeBSD-src-41a8d8c29552ddd9098cfb09a71927f503a28371.zip FreeBSD-src-41a8d8c29552ddd9098cfb09a71927f503a28371.tar.gz |
Migrate most of tools/regression/usr.bin/ to the new tests layout.
I'm starting with the easy cases. The leftovers need to be looked at a
bit more closely.
Note that this change _does_ modify the code of the old tests. This is
required in order to allow the code to locate the data files in the
source directory instead of the current directory, because Kyua
automatically changes the latter to a temporary directory.
Also note that at least one test is known to be broken here. Actually,
the test is not really broken: it's marked as a TODO but unfortunately
Kyua's TAP parser currently does not understand that. Will have to be
fixed separately.
Diffstat (limited to 'usr.bin/tr/tests')
-rw-r--r-- | usr.bin/tr/tests/Makefile | 26 | ||||
-rw-r--r-- | usr.bin/tr/tests/legacy_test.sh | 6 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.00.out | 4 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.01.out | 4 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.02.out | 4 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.03.out | 4 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.04.out | 4 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.05.out | 4 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.06.out | 9 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.07.out | 9 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.08.out | 9 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.09.out | 1 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.0a.out | 1 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.0b.out | 1 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.0c.out | 1 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.0d.out | 1 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.in | 4 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress.sh | 22 | ||||
-rw-r--r-- | usr.bin/tr/tests/regress2.in | 9 |
19 files changed, 123 insertions, 0 deletions
diff --git a/usr.bin/tr/tests/Makefile b/usr.bin/tr/tests/Makefile new file mode 100644 index 0000000..58e4fadc --- /dev/null +++ b/usr.bin/tr/tests/Makefile @@ -0,0 +1,26 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/tr + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= regress.00.out +FILES+= regress.01.out +FILES+= regress.02.out +FILES+= regress.03.out +FILES+= regress.04.out +FILES+= regress.05.out +FILES+= regress.06.out +FILES+= regress.07.out +FILES+= regress.08.out +FILES+= regress.09.out +FILES+= regress.0a.out +FILES+= regress.0b.out +FILES+= regress.0c.out +FILES+= regress.0d.out +FILES+= regress.in +FILES+= regress.sh +FILES+= regress2.in + +.include <bsd.test.mk> diff --git a/usr.bin/tr/tests/legacy_test.sh b/usr.bin/tr/tests/legacy_test.sh new file mode 100644 index 0000000..1b6b806 --- /dev/null +++ b/usr.bin/tr/tests/legacy_test.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ + +SRCDIR="$(dirname "${0}")"; export SRCDIR + +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh diff --git a/usr.bin/tr/tests/regress.00.out b/usr.bin/tr/tests/regress.00.out new file mode 100644 index 0000000..5a7d1c7 --- /dev/null +++ b/usr.bin/tr/tests/regress.00.out @@ -0,0 +1,4 @@ +qui3k 2rown +fox jump54 +ov5r th5 l1zy +4og diff --git a/usr.bin/tr/tests/regress.01.out b/usr.bin/tr/tests/regress.01.out new file mode 100644 index 0000000..5252b48 --- /dev/null +++ b/usr.bin/tr/tests/regress.01.out @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the lazy +dog diff --git a/usr.bin/tr/tests/regress.02.out b/usr.bin/tr/tests/regress.02.out new file mode 100644 index 0000000..67a6dea --- /dev/null +++ b/usr.bin/tr/tests/regress.02.out @@ -0,0 +1,4 @@ +quik brown +fox jumpd +ovr th lzy +do diff --git a/usr.bin/tr/tests/regress.03.out b/usr.bin/tr/tests/regress.03.out new file mode 100644 index 0000000..c18e3cf --- /dev/null +++ b/usr.bin/tr/tests/regress.03.out @@ -0,0 +1,4 @@ +QUICK BROWN +FOX JUMPED +OVER THE LAZY +DOG diff --git a/usr.bin/tr/tests/regress.04.out b/usr.bin/tr/tests/regress.04.out new file mode 100644 index 0000000..c01413c --- /dev/null +++ b/usr.bin/tr/tests/regress.04.out @@ -0,0 +1,4 @@ +..... ..... +... ...... +.... ... .... +... diff --git a/usr.bin/tr/tests/regress.05.out b/usr.bin/tr/tests/regress.05.out new file mode 100644 index 0000000..5252b48 --- /dev/null +++ b/usr.bin/tr/tests/regress.05.out @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the lazy +dog diff --git a/usr.bin/tr/tests/regress.06.out b/usr.bin/tr/tests/regress.06.out new file mode 100644 index 0000000..5ca0a4f --- /dev/null +++ b/usr.bin/tr/tests/regress.06.out @@ -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 --git a/usr.bin/tr/tests/regress.07.out b/usr.bin/tr/tests/regress.07.out new file mode 100644 index 0000000..999fe47 --- /dev/null +++ b/usr.bin/tr/tests/regress.07.out @@ -0,0 +1,9 @@ +### ####### ## #### ## ### ####, ### ####### ## ####. +#### ### #### ### #### ## ###### - ## ####### ## #### ## ### ####. +## ####### ## #### ## ### ####, ## ####### ## ####. +#### ### #### ### #### ## ###### - ## ####### ## #### ## ### ####. +... +# ####### ## #### ## ### ####, # ####### ## ####!!! +#### ### #### ### #### ## ###### - # ###### ## #### ## ### ####. +# ###### ## #### ## ### ####, # ###### ## ####!!! +#### ## #### ### #### ## ###### - ## #### ####### ## #### ## ### ####!!! diff --git a/usr.bin/tr/tests/regress.08.out b/usr.bin/tr/tests/regress.08.out new file mode 100644 index 0000000..34abcc1 --- /dev/null +++ b/usr.bin/tr/tests/regress.08.out @@ -0,0 +1,9 @@ +100,100. +-99. +99,99. +-98. +... +2,2!!! +-1. +1,1!!! +-!!! diff --git a/usr.bin/tr/tests/regress.09.out b/usr.bin/tr/tests/regress.09.out new file mode 100644 index 0000000..2419e3a --- /dev/null +++ b/usr.bin/tr/tests/regress.09.out @@ -0,0 +1 @@ +?# diff --git a/usr.bin/tr/tests/regress.0a.out b/usr.bin/tr/tests/regress.0a.out new file mode 100644 index 0000000..e703f63 --- /dev/null +++ b/usr.bin/tr/tests/regress.0a.out @@ -0,0 +1 @@ +$?$$$$$$$$ diff --git a/usr.bin/tr/tests/regress.0b.out b/usr.bin/tr/tests/regress.0b.out new file mode 100644 index 0000000..8d26586 --- /dev/null +++ b/usr.bin/tr/tests/regress.0b.out @@ -0,0 +1 @@ +100befbeeea100befbeeaeedadaad99befbeeea99befbeeea99befbeeaeedadaad98befbeeea2befbeeea2befbeeaeedadaad1befbeeea1befbeeea1befbeeaedadaadEbefbeeea diff --git a/usr.bin/tr/tests/regress.0c.out b/usr.bin/tr/tests/regress.0c.out new file mode 100644 index 0000000..4e125ea --- /dev/null +++ b/usr.bin/tr/tests/regress.0c.out @@ -0,0 +1 @@ +[[[[ diff --git a/usr.bin/tr/tests/regress.0d.out b/usr.bin/tr/tests/regress.0d.out new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/usr.bin/tr/tests/regress.0d.out @@ -0,0 +1 @@ + diff --git a/usr.bin/tr/tests/regress.in b/usr.bin/tr/tests/regress.in new file mode 100644 index 0000000..5252b48 --- /dev/null +++ b/usr.bin/tr/tests/regress.in @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the lazy +dog diff --git a/usr.bin/tr/tests/regress.sh b/usr.bin/tr/tests/regress.sh new file mode 100644 index 0000000..682cf23 --- /dev/null +++ b/usr.bin/tr/tests/regress.sh @@ -0,0 +1,22 @@ +# $FreeBSD$ + +echo 1..14 + +REGRESSION_START($1) + +REGRESSION_TEST(`00', `tr abcde 12345 <${SRCDIR}/regress.in') +REGRESSION_TEST(`01', `tr 12345 abcde <${SRCDIR}/regress.in') +REGRESSION_TEST(`02', `tr -d aceg <${SRCDIR}/regress.in') +REGRESSION_TEST(`03', `tr "[[:lower:]]" "[[:upper:]]" <${SRCDIR}/regress.in') +REGRESSION_TEST(`04', `tr "[[:alpha:]]" . <${SRCDIR}/regress.in') +REGRESSION_TEST(`05', `tr "[[:lower:]]" "[[:upper:]]" <${SRCDIR}/regress.in | tr "[[:upper:]]" "[[:lower:]]"') +REGRESSION_TEST(`06', `tr "[[:digit:]]" "?" <${SRCDIR}/regress2.in') +REGRESSION_TEST(`07', `tr "[[:alnum:]]" "#" <${SRCDIR}/regress2.in') +REGRESSION_TEST(`08', `tr "[[:upper:]]" "[[:lower:]]" <${SRCDIR}/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:]]" <${SRCDIR}/regress2.in ; echo)') +REGRESSION_TEST(`0c', `echo "[[[[]]]]" | tr -d "[=]=]"') +REGRESSION_TEST(`0d', `echo "]=[" | tr -d "[=]"') + +REGRESSION_END() diff --git a/usr.bin/tr/tests/regress2.in b/usr.bin/tr/tests/regress2.in new file mode 100644 index 0000000..c416463 --- /dev/null +++ b/usr.bin/tr/tests/regress2.in @@ -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!!! |