summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-11-30 20:26:33 +0000
committerJim Meyering <jim@meyering.net>1995-11-30 20:26:33 +0000
commit5eeef11a3b136e235cf3b868e49c231b4f569cfb (patch)
tree92f08765f7f74cebc1f6038159b72881c6fc6a27 /tests
parentcfbca54a71283153bdfde431ab606bd91ae8b519 (diff)
downloadcoreutils-5eeef11a3b136e235cf3b868e49c231b4f569cfb.tar.xz
standardizing...
Diffstat (limited to 'tests')
-rwxr-xr-xtests/sort/build-script10
-rwxr-xr-xtests/tr/build-script17
-rwxr-xr-xtests/tr/test.data.pl2
3 files changed, 16 insertions, 13 deletions
diff --git a/tests/sort/build-script b/tests/sort/build-script
index 970dcf8c9..5c2b2d4ba 100755
--- a/tests/sort/build-script
+++ b/tests/sort/build-script
@@ -1,11 +1,11 @@
#!/p/bin/perl -w
-$sort = './sort';
+$xx = './sort';
$test = 0;
$| = 1;
-print "#! /bin/sh\nsort='$sort'\necho testing with sort=\$sort\nerrors=0\n";
-print "$sort --version 2> /dev/null\n";
+print "#! /bin/sh\nxx='$xx'\necho testing with $xx=\$xx\nerrors=0\n";
+print "$xx --version 2> /dev/null\n";
$expected = '';
$input = '';
$options = '';
@@ -35,12 +35,12 @@ while (<>)
print EXP $expected;
close(EXP);
$err_output = "t$test_name.err";
- $cmd = "\$sort $options $in > $out 2> $err_output";
+ $cmd = "\$xx $options $in > $out 2> $err_output";
print <<EOF ;
$cmd
code=\$?
if test \$code != $e_ret_code ; then
- echo Test $test_name failed: sort return code \$code differs from expected value $e_ret_code 1>&2
+ echo Test $test_name failed: $xx return code \$code differs from expected value $e_ret_code 1>&2
errors=`expr \$errors + 1`
else
cmp $out $exp_name
diff --git a/tests/tr/build-script b/tests/tr/build-script
index 4864c2b34..6e55d8b0b 100755
--- a/tests/tr/build-script
+++ b/tests/tr/build-script
@@ -1,13 +1,11 @@
#!/p/bin/perl -w
-$tr = '../tr +io 5';
-$tr = 'tr';
-$tr = './tr';
+$xx = './tr';
$test = 0;
$| = 1;
-print "#! /bin/sh\ntr='$tr'\necho testing with tr=\$tr\nerrors=0\n";
-print "$tr --version 2> /dev/null\n";
+print "#! /bin/sh\nxx='$xx'\necho testing with $xx=\$xx\nerrors=0\n";
+print "$xx --version 2> /dev/null\n";
$expected = '';
$s1 = '';
$input = '';
@@ -22,6 +20,11 @@ while (<>)
chop;
$prog = '($test_name, $input,$flags,$s1,$s2,$expected,$e_ret_code) = ' . $_ . ';';
eval $prog;
+ if (defined ($seen{$test_name}))
+ {
+ die "$0: $.: duplicate test name \`$test_name'\n";
+ }
+ $seen{$test_name} = 1;
$in = "t$test_name.in";
$exp_name = 't' . $test_name . '.exp';
$out = "t$test_name.out";
@@ -35,12 +38,12 @@ while (<>)
close(EXP);
$arg2 = ($s2 ? " '$s2'" : '');
$err_output = "t$test_name.err";
- $cmd = "\$tr $flags \'$s1\'$arg2 < $in > $out 2> $err_output";
+ $cmd = "\$xx $flags \'$s1\'$arg2 < $in > $out 2> $err_output";
print <<EOF ;
$cmd
code=\$?
if test \$code != $e_ret_code ; then
- echo Test $test_name failed: tr return code \$code differs from expected value $e_ret_code 1>&2
+ echo Test $test_name failed: $xx return code \$code differs from expected value $e_ret_code 1>&2
errors=`expr \$errors + 1`
else
cmp $out $exp_name
diff --git a/tests/tr/test.data.pl b/tests/tr/test.data.pl
index b5acbb367..3d804734e 100755
--- a/tests/tr/test.data.pl
+++ b/tests/tr/test.data.pl
@@ -61,7 +61,7 @@
("B", "", '', 'a',"''", "", 1);
("C", "abcxyzABCXYZ", '', '[:lower:]', '[:upper:]', "ABCXYZABCXYZ", 0);
("D", "abcxyzABCXYZ", '', '[:upper:]', '[:lower:]', "abcxyzabcxyz", 0);
-
+#
("E", "a=c", '', 'a[=*2][=c=]', 'xyyz', "xyz", 0);
("F", ":1239", '', '[:*3][:digit:]', 'a-m', "cefgm", 0);
("G", "abc", '', 'a[b*512]c', '1[x*]2', "1x2", 0);