From 477fc93c59242ec8bab916a4b30863f170c262ad Mon Sep 17 00:00:00 2001 From: rillig Date: Thu, 24 Nov 2005 19:46:45 +0000 Subject: Added more tests for tr(1), including one that feeds 65536 bytes through tr(1). Let's see if there's an implementation with bounded line lengths. --- regress/tools/files/tr-test.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'regress/tools') diff --git a/regress/tools/files/tr-test.sh b/regress/tools/files/tr-test.sh index 071b8fbb5a3..32366311a55 100644 --- a/regress/tools/files/tr-test.sh +++ b/regress/tools/files/tr-test.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $NetBSD: tr-test.sh,v 1.1 2005/11/24 19:39:23 rillig Exp $ +# $NetBSD: tr-test.sh,v 1.2 2005/11/24 19:46:45 rillig Exp $ # set -e @@ -26,6 +26,7 @@ EOF # # The actual test. # + nl=" " @@ -35,3 +36,21 @@ tr_test "tolower" \ "The Great Green Fox" "the great green fox" "A-Z" "a-z" tr_test "eat-newlines" \ "foo${nl}bar${nl}" "foobar" -d "\\n" +tr_test "eat-minus" \ + "describe-function" "describefunction" -d "-" +# The following test does not work on NetBSD 1.6.2. +#tr_test "eat-minus-d" \ +# "describe-function" "escribefunction" -d "-d" +tr_test "eat-d-minus" \ + "describe-function" "escribefunction" -d "d-" + +s="0123456789abcdef" +s="$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s" +s="$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s" +s="$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s" +f="ffffffffffffffff" +f="$f$f$f$f$f$f$f$f$f$f$f$f$f$f$f$f" +f="$f$f$f$f$f$f$f$f$f$f$f$f$f$f$f$f" + +tr_test "65536" \ + "$s" "$f" -d "0-9a-e" -- cgit v1.2.3