1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 11:16:16 +02:00
This commit is contained in:
Jim Meyering
1997-01-23 04:12:43 +00:00
parent 598a7bda46
commit b66a30133f
4 changed files with 104 additions and 6 deletions

View File

@@ -11,7 +11,8 @@ tobs-3.in tobs-3.exp tobs-4.in tobs-4.exp tobs-5.in tobs-5.exp tobsx-1.in \
tobsx-1.exp tobsx-2.in tobsx-2.exp tobs-l.in tobs-l.exp terr-1.in terr-1.exp \
terr-2.in terr-2.exp terr-3.in terr-3.exp terr-4.in terr-4.exp tstdin-1.in \
tstdin-1.exp tstdin-2.in tstdin-2.exp tn-1.in tn-1.exp tn-2.in tn-2.exp \
tn-3.in tn-3.exp
tn-3.in tn-3.exp tn-4.in tn-4.exp tn-4a.in tn-4a.exp tn-5.in tn-5.exp \
tn-5a.in tn-5a.exp tn-5b.in tn-5b.exp
run_gen = tobs-c1.out tobs-c1.err tobs-c2.out tobs-c2.err tobs-c3.out \
tobs-c3.err tobs-c4.out tobs-c4.err tobs-c5.out tobs-c5.err tobs-l1.out \
tobs-l1.err tobs-l2.out tobs-l2.err tobs-l3.out tobs-l3.err tobs-l4.out \
@@ -20,7 +21,8 @@ tobs-2.err tobs-3.out tobs-3.err tobs-4.out tobs-4.err tobs-5.out tobs-5.err \
tobsx-1.out tobsx-1.err tobsx-2.out tobsx-2.err tobs-l.out tobs-l.err \
terr-1.out terr-1.err terr-2.out terr-2.err terr-3.out terr-3.err terr-4.out \
terr-4.err tstdin-1.out tstdin-1.err tstdin-2.out tstdin-2.err tn-1.out \
tn-1.err tn-2.out tn-2.err tn-3.out tn-3.err
tn-1.err tn-2.out tn-2.err tn-3.out tn-3.err tn-4.out tn-4.err tn-4a.out \
tn-4a.err tn-5.out tn-5.err tn-5a.out tn-5a.err tn-5b.out tn-5b.err
##test-files-end
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)

View File

@@ -52,7 +52,8 @@ tobs-3.in tobs-3.exp tobs-4.in tobs-4.exp tobs-5.in tobs-5.exp tobsx-1.in \
tobsx-1.exp tobsx-2.in tobsx-2.exp tobs-l.in tobs-l.exp terr-1.in terr-1.exp \
terr-2.in terr-2.exp terr-3.in terr-3.exp terr-4.in terr-4.exp tstdin-1.in \
tstdin-1.exp tstdin-2.in tstdin-2.exp tn-1.in tn-1.exp tn-2.in tn-2.exp \
tn-3.in tn-3.exp
tn-3.in tn-3.exp tn-4.in tn-4.exp tn-4a.in tn-4a.exp tn-5.in tn-5.exp \
tn-5a.in tn-5a.exp tn-5b.in tn-5b.exp
run_gen = tobs-c1.out tobs-c1.err tobs-c2.out tobs-c2.err tobs-c3.out \
tobs-c3.err tobs-c4.out tobs-c4.err tobs-c5.out tobs-c5.err tobs-l1.out \
tobs-l1.err tobs-l2.out tobs-l2.err tobs-l3.out tobs-l3.err tobs-l4.out \
@@ -61,7 +62,8 @@ tobs-2.err tobs-3.out tobs-3.err tobs-4.out tobs-4.err tobs-5.out tobs-5.err \
tobsx-1.out tobsx-1.err tobsx-2.out tobsx-2.err tobs-l.out tobs-l.err \
terr-1.out terr-1.err terr-2.out terr-2.err terr-3.out terr-3.err terr-4.out \
terr-4.err tstdin-1.out tstdin-1.err tstdin-2.out tstdin-2.err tn-1.out \
tn-1.err tn-2.out tn-2.err tn-3.out tn-3.err
tn-1.err tn-2.out tn-2.err tn-3.out tn-3.err tn-4.out tn-4.err tn-4a.out \
tn-4a.err tn-5.out tn-5.err tn-5a.out tn-5a.err tn-5b.out tn-5b.err
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests

View File

@@ -42,7 +42,7 @@ my @tv = (
# Since the number is larger than 2^64, this should provoke
# the diagnostic: `tail: 99999999999999999999: number of bytes is so large \
# that it is not representable' on all systems... for now, probably, maybe.
# that it is not representable' on all systems... probably, for now, maybe.
['err-3', '-c99999999999999999999', '', '', 1],
['err-4', '-c', '', '', 1],
@@ -53,6 +53,15 @@ my @tv = (
['n-1', '-n 10', "x\n" . ("y\n" x 10) . 'z', ("y\n" x 9) . 'z', 0],
['n-2', '-n -10', "x\n" . ("y\n" x 10) . 'z', ("y\n" x 9) . 'z', 0],
['n-3', '-n +10', "x\n" . ("y\n" x 10) . 'z', "y\ny\nz", 0],
# Accept +0 as synonym for +1.
['n-4', '-n +0', "y\n" x 5, "y\n" x 5, 0],
['n-4a', '-n +1', "y\n" x 5, "y\n" x 5, 0],
# Note that -0 is *not* a synonym for -1.
['n-5', '-n -0', "y\n" x 5, '', 0],
['n-5a', '-n -1', "y\n" x 5, "y\n", 0],
['n-5b', '-n 0', "y\n" x 5, '', 0],
);
sub test_vector

View File

@@ -468,8 +468,93 @@ else
esac
fi
test -s tn-3.err || rm -f tn-3.err
$xx -n +0 < $srcdir/tn-4.in > tn-4.out 2> tn-4.err
code=$?
if test $code != 0 ; then
$echo Test n-4 failed: ../../src/tail return code $code differs from expected value 0 1>&2
errors=`expr $errors + 1`
else
cmp tn-4.out $srcdir/tn-4.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed n-4; fi ;; # equal files
1) $echo Test n-4 failed: files tn-4.out and $srcdir/tn-4.exp differ 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test n-4 may have failed. 1>&2;
$echo The command "cmp tn-4.out $srcdir/tn-4.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tn-4.err || rm -f tn-4.err
$xx -n +1 < $srcdir/tn-4a.in > tn-4a.out 2> tn-4a.err
code=$?
if test $code != 0 ; then
$echo Test n-4a failed: ../../src/tail return code $code differs from expected value 0 1>&2
errors=`expr $errors + 1`
else
cmp tn-4a.out $srcdir/tn-4a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed n-4a; fi ;; # equal files
1) $echo Test n-4a failed: files tn-4a.out and $srcdir/tn-4a.exp differ 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test n-4a may have failed. 1>&2;
$echo The command "cmp tn-4a.out $srcdir/tn-4a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tn-4a.err || rm -f tn-4a.err
$xx -n -0 < $srcdir/tn-5.in > tn-5.out 2> tn-5.err
code=$?
if test $code != 0 ; then
$echo Test n-5 failed: ../../src/tail return code $code differs from expected value 0 1>&2
errors=`expr $errors + 1`
else
cmp tn-5.out $srcdir/tn-5.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed n-5; fi ;; # equal files
1) $echo Test n-5 failed: files tn-5.out and $srcdir/tn-5.exp differ 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test n-5 may have failed. 1>&2;
$echo The command "cmp tn-5.out $srcdir/tn-5.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tn-5.err || rm -f tn-5.err
$xx -n -1 < $srcdir/tn-5a.in > tn-5a.out 2> tn-5a.err
code=$?
if test $code != 0 ; then
$echo Test n-5a failed: ../../src/tail return code $code differs from expected value 0 1>&2
errors=`expr $errors + 1`
else
cmp tn-5a.out $srcdir/tn-5a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed n-5a; fi ;; # equal files
1) $echo Test n-5a failed: files tn-5a.out and $srcdir/tn-5a.exp differ 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test n-5a may have failed. 1>&2;
$echo The command "cmp tn-5a.out $srcdir/tn-5a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tn-5a.err || rm -f tn-5a.err
$xx -n 0 < $srcdir/tn-5b.in > tn-5b.out 2> tn-5b.err
code=$?
if test $code != 0 ; then
$echo Test n-5b failed: ../../src/tail return code $code differs from expected value 0 1>&2
errors=`expr $errors + 1`
else
cmp tn-5b.out $srcdir/tn-5b.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed n-5b; fi ;; # equal files
1) $echo Test n-5b failed: files tn-5b.out and $srcdir/tn-5b.exp differ 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test n-5b may have failed. 1>&2;
$echo The command "cmp tn-5b.out $srcdir/tn-5b.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tn-5b.err || rm -f tn-5b.err
if test $errors = 0 ; then
$echo Passed all 27 tests. 1>&2
$echo Passed all 32 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi