summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-01-23 03:55:50 +0000
committerJim Meyering <jim@meyering.net>1997-01-23 03:55:50 +0000
commitb22469537b8b46b1de3186c9c1716afb832c2bab (patch)
tree8b847ed3a77d9238973eaa820b5550ac9614d32b /tests
parent591844b3873fffcd71acfa8c85421d99ec3ca971 (diff)
downloadcoreutils-b22469537b8b46b1de3186c9c1716afb832c2bab.tar.xz
.
Diffstat (limited to 'tests')
-rw-r--r--tests/tail/Makefile.am12
-rw-r--r--tests/tail/Makefile.in12
-rwxr-xr-xtests/tail/Test.pm6
-rwxr-xr-xtests/tail/tail-tests34
4 files changed, 33 insertions, 31 deletions
diff --git a/tests/tail/Makefile.am b/tests/tail/Makefile.am
index 96b4c36dd..6131455d2 100644
--- a/tests/tail/Makefile.am
+++ b/tests/tail/Makefile.am
@@ -8,17 +8,17 @@ tobs-c3.exp tobs-c4.in tobs-c4.exp tobs-c5.in tobs-c5.exp tobs-l1.in \
tobs-l1.exp tobs-l2.in tobs-l2.exp tobs-l3.in tobs-l3.exp tobs-l4.in \
tobs-l4.exp tobs-l5.in tobs-l5.exp tobs-1.in tobs-1.exp tobs-2.in tobs-2.exp \
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 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 tstdin-3.in tstdin-3.exp
+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
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 \
tobs-l4.err tobs-l5.out tobs-l5.err tobs-1.out tobs-1.err tobs-2.out \
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 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 tstdin-3.out tstdin-3.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
##test-files-end
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
diff --git a/tests/tail/Makefile.in b/tests/tail/Makefile.in
index 45128c16c..f42a6647f 100644
--- a/tests/tail/Makefile.in
+++ b/tests/tail/Makefile.in
@@ -49,17 +49,17 @@ tobs-c3.exp tobs-c4.in tobs-c4.exp tobs-c5.in tobs-c5.exp tobs-l1.in \
tobs-l1.exp tobs-l2.in tobs-l2.exp tobs-l3.in tobs-l3.exp tobs-l4.in \
tobs-l4.exp tobs-l5.in tobs-l5.exp tobs-1.in tobs-1.exp tobs-2.in tobs-2.exp \
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 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 tstdin-3.in tstdin-3.exp
+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
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 \
tobs-l4.err tobs-l5.out tobs-l5.err tobs-1.out tobs-1.err tobs-2.out \
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 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 tstdin-3.out tstdin-3.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
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
diff --git a/tests/tail/Test.pm b/tests/tail/Test.pm
index b1b2e8646..c0936e1e5 100755
--- a/tests/tail/Test.pm
+++ b/tests/tail/Test.pm
@@ -13,6 +13,7 @@ my @tv = (
['obs-c4', '-9c', 'abcd', 'abcd', 0],
['obs-c5', '-12c', 'x' . ('y' x 12) . 'z', ('y' x 11) . 'z', 0],
+
['obs-l1', '-1l', 'x', 'x', 0],
['obs-l2', '-1l', "x\ny\n", "y\n", 0],
['obs-l3', '-1l', "x\ny", "y", 0],
@@ -30,6 +31,8 @@ my @tv = (
['obsx-1', '+c', 'x' . ('y' x 10) . 'z', 'yyz', 0],
# This is equivalent to +10l
['obsx-2', '+l', "x\n" . ("y\n" x 10) . 'z', "y\ny\nz", 0],
+# With no number, this is like -10l
+['obs-l', '-l', "x\n" . ("y\n" x 10) . 'z', ("y\n" x 9) . 'z', 0],
# This should get `tail: +cl: No such file or directory'
['err-1', '+cl', '', '', 1],
@@ -39,14 +42,13 @@ 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'
+# that it is not representable' on all systems... for now, probably, maybe.
['err-3', '-c99999999999999999999', '', '', 1],
['err-4', '-c', '', '', 1],
# Same as -l 10
['stdin-1', '-', '', '', 0],
['stdin-2', '-', "x\n" . ("y\n" x 10) . 'z', ("y\n" x 9) . 'z', 0],
-['stdin-3', '-l 10', "x\n" . ("y\n" x 10) . 'z', ("y\n" x 9) . 'z', 0],
);
sub test_vector
diff --git a/tests/tail/tail-tests b/tests/tail/tail-tests
index 27398be4a..9c554642b 100755
--- a/tests/tail/tail-tests
+++ b/tests/tail/tail-tests
@@ -298,6 +298,23 @@ else
esac
fi
test -s tobsx-2.err || rm -f tobsx-2.err
+$xx -l < $srcdir/tobs-l.in > tobs-l.out 2> tobs-l.err
+code=$?
+if test $code != 0 ; then
+ $echo Test obs-l failed: ../../src/tail return code $code differs from expected value 0 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp tobs-l.out $srcdir/tobs-l.exp
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo passed obs-l; fi ;; # equal files
+ 1) $echo Test obs-l failed: files tobs-l.out and $srcdir/tobs-l.exp differ 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo Test obs-l may have failed. 1>&2;
+ $echo The command "cmp tobs-l.out $srcdir/tobs-l.exp" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s tobs-l.err || rm -f tobs-l.err
$xx +cl < $srcdir/terr-1.in > terr-1.out 2> terr-1.err
code=$?
if test $code != 1 ; then
@@ -400,23 +417,6 @@ else
esac
fi
test -s tstdin-2.err || rm -f tstdin-2.err
-$xx -l 10 < $srcdir/tstdin-3.in > tstdin-3.out 2> tstdin-3.err
-code=$?
-if test $code != 0 ; then
- $echo Test stdin-3 failed: ../../src/tail return code $code differs from expected value 0 1>&2
- errors=`expr $errors + 1`
-else
- cmp tstdin-3.out $srcdir/tstdin-3.exp
- case $? in
- 0) if test "$VERBOSE" ; then $echo passed stdin-3; fi ;; # equal files
- 1) $echo Test stdin-3 failed: files tstdin-3.out and $srcdir/tstdin-3.exp differ 1>&2;
- errors=`expr $errors + 1` ;;
- 2) $echo Test stdin-3 may have failed. 1>&2;
- $echo The command "cmp tstdin-3.out $srcdir/tstdin-3.exp" failed. 1>&2 ;
- errors=`expr $errors + 1` ;;
- esac
-fi
-test -s tstdin-3.err || rm -f tstdin-3.err
if test $errors = 0 ; then
$echo Passed all 24 tests. 1>&2
else