summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-01-24 01:16:39 +0000
committerJim Meyering <jim@meyering.net>1997-01-24 01:16:39 +0000
commit8a66d0dd57ce7f7eb7c2b37e1901621065fcbf84 (patch)
tree5baf603d075c09bfc9dcfb9aa46678c0aeaa91b1 /tests
parent1f678023d5e361ab539c07d2c686e649797d1334 (diff)
downloadcoreutils-8a66d0dd57ce7f7eb7c2b37e1901621065fcbf84.tar.xz
.
Diffstat (limited to 'tests')
-rw-r--r--tests/tail/Makefile.am16
-rw-r--r--tests/tail/Makefile.in16
-rwxr-xr-xtests/tail/Test.pm14
-rwxr-xr-xtests/tail/tail-tests72
4 files changed, 81 insertions, 37 deletions
diff --git a/tests/tail/Makefile.am b/tests/tail/Makefile.am
index be5cf02c6..ab82c1a13 100644
--- a/tests/tail/Makefile.am
+++ b/tests/tail/Makefile.am
@@ -9,10 +9,11 @@ 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 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-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
+terr-2.in terr-2.exp terr-3.in terr-3.exp terr-4.in terr-4.exp terr-5.in \
+terr-5.exp terr-6.in terr-6.exp tminus-1.in tminus-1.exp tminus-2.in \
+tminus-2.exp tn-1.in tn-1.exp tn-2.in tn-2.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,9 +21,10 @@ 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 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-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
+terr-4.err terr-5.out terr-5.err terr-6.out terr-6.err tminus-1.out \
+tminus-1.err tminus-2.out tminus-2.err tn-1.out 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)
diff --git a/tests/tail/Makefile.in b/tests/tail/Makefile.in
index 4356c60b0..123a8f8cd 100644
--- a/tests/tail/Makefile.in
+++ b/tests/tail/Makefile.in
@@ -50,10 +50,11 @@ 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 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-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
+terr-2.in terr-2.exp terr-3.in terr-3.exp terr-4.in terr-4.exp terr-5.in \
+terr-5.exp terr-6.in terr-6.exp tminus-1.in tminus-1.exp tminus-2.in \
+tminus-2.exp tn-1.in tn-1.exp tn-2.in tn-2.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,9 +62,10 @@ 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 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-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
+terr-4.err terr-5.out terr-5.err terr-6.out terr-6.err tminus-1.out \
+tminus-1.err tminus-2.out tminus-2.err tn-1.out 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
diff --git a/tests/tail/Test.pm b/tests/tail/Test.pm
index 5a0fddad9..4ec332b7b 100755
--- a/tests/tail/Test.pm
+++ b/tests/tail/Test.pm
@@ -40,15 +40,21 @@ my @tv = (
# This should get `tail: l: invalid number of bytes'
['err-2', '-cl', '', '', 1],
+# This should get `tail: z: invalid suffix character in obsolescent option'
+['err-3', '+2cz', '', '', 1],
+
+# This should get `tail: X: invalid suffix character in obsolescent option'
+['err-4', '-2cX', '', '', 1],
+
# 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... probably, for now, maybe.
-['err-3', '-c99999999999999999999', '', '', 1],
-['err-4', '-c', '', '', 1],
+['err-5', '-c99999999999999999999', '', '', 1],
+['err-6', '-c', '', '', 1],
# Same as -n 10
-['stdin-1', '-', '', '', 0],
-['stdin-2', '-', "x\n" . ("y\n" x 10) . 'z', ("y\n" x 9) . 'z', 0],
+['minus-1', '-', '', '', 0],
+['minus-2', '-', "x\n" . ("y\n" x 10) . 'z', ("y\n" x 9) . 'z', 0],
['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],
diff --git a/tests/tail/tail-tests b/tests/tail/tail-tests
index c59274f95..d44954eaa 100755
--- a/tests/tail/tail-tests
+++ b/tests/tail/tail-tests
@@ -349,7 +349,7 @@ else
esac
fi
test -s terr-2.err || rm -f terr-2.err
-$xx -c99999999999999999999 < $srcdir/terr-3.in > terr-3.out 2> terr-3.err
+$xx +2cz < $srcdir/terr-3.in > terr-3.out 2> terr-3.err
code=$?
if test $code != 1 ; then
$echo Test err-3 failed: ../../src/tail return code $code differs from expected value 1 1>&2
@@ -366,7 +366,7 @@ else
esac
fi
test -s terr-3.err || rm -f terr-3.err
-$xx -c < $srcdir/terr-4.in > terr-4.out 2> terr-4.err
+$xx -2cX < $srcdir/terr-4.in > terr-4.out 2> terr-4.err
code=$?
if test $code != 1 ; then
$echo Test err-4 failed: ../../src/tail return code $code differs from expected value 1 1>&2
@@ -383,40 +383,74 @@ else
esac
fi
test -s terr-4.err || rm -f terr-4.err
-$xx - < $srcdir/tstdin-1.in > tstdin-1.out 2> tstdin-1.err
+$xx -c99999999999999999999 < $srcdir/terr-5.in > terr-5.out 2> terr-5.err
+code=$?
+if test $code != 1 ; then
+ $echo Test err-5 failed: ../../src/tail return code $code differs from expected value 1 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp terr-5.out $srcdir/terr-5.exp
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo passed err-5; fi ;; # equal files
+ 1) $echo Test err-5 failed: files terr-5.out and $srcdir/terr-5.exp differ 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo Test err-5 may have failed. 1>&2;
+ $echo The command "cmp terr-5.out $srcdir/terr-5.exp" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s terr-5.err || rm -f terr-5.err
+$xx -c < $srcdir/terr-6.in > terr-6.out 2> terr-6.err
+code=$?
+if test $code != 1 ; then
+ $echo Test err-6 failed: ../../src/tail return code $code differs from expected value 1 1>&2
+ errors=`expr $errors + 1`
+else
+ cmp terr-6.out $srcdir/terr-6.exp
+ case $? in
+ 0) if test "$VERBOSE" ; then $echo passed err-6; fi ;; # equal files
+ 1) $echo Test err-6 failed: files terr-6.out and $srcdir/terr-6.exp differ 1>&2;
+ errors=`expr $errors + 1` ;;
+ 2) $echo Test err-6 may have failed. 1>&2;
+ $echo The command "cmp terr-6.out $srcdir/terr-6.exp" failed. 1>&2 ;
+ errors=`expr $errors + 1` ;;
+ esac
+fi
+test -s terr-6.err || rm -f terr-6.err
+$xx - < $srcdir/tminus-1.in > tminus-1.out 2> tminus-1.err
code=$?
if test $code != 0 ; then
- $echo Test stdin-1 failed: ../../src/tail return code $code differs from expected value 0 1>&2
+ $echo Test minus-1 failed: ../../src/tail return code $code differs from expected value 0 1>&2
errors=`expr $errors + 1`
else
- cmp tstdin-1.out $srcdir/tstdin-1.exp
+ cmp tminus-1.out $srcdir/tminus-1.exp
case $? in
- 0) if test "$VERBOSE" ; then $echo passed stdin-1; fi ;; # equal files
- 1) $echo Test stdin-1 failed: files tstdin-1.out and $srcdir/tstdin-1.exp differ 1>&2;
+ 0) if test "$VERBOSE" ; then $echo passed minus-1; fi ;; # equal files
+ 1) $echo Test minus-1 failed: files tminus-1.out and $srcdir/tminus-1.exp differ 1>&2;
errors=`expr $errors + 1` ;;
- 2) $echo Test stdin-1 may have failed. 1>&2;
- $echo The command "cmp tstdin-1.out $srcdir/tstdin-1.exp" failed. 1>&2 ;
+ 2) $echo Test minus-1 may have failed. 1>&2;
+ $echo The command "cmp tminus-1.out $srcdir/tminus-1.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
-test -s tstdin-1.err || rm -f tstdin-1.err
-$xx - < $srcdir/tstdin-2.in > tstdin-2.out 2> tstdin-2.err
+test -s tminus-1.err || rm -f tminus-1.err
+$xx - < $srcdir/tminus-2.in > tminus-2.out 2> tminus-2.err
code=$?
if test $code != 0 ; then
- $echo Test stdin-2 failed: ../../src/tail return code $code differs from expected value 0 1>&2
+ $echo Test minus-2 failed: ../../src/tail return code $code differs from expected value 0 1>&2
errors=`expr $errors + 1`
else
- cmp tstdin-2.out $srcdir/tstdin-2.exp
+ cmp tminus-2.out $srcdir/tminus-2.exp
case $? in
- 0) if test "$VERBOSE" ; then $echo passed stdin-2; fi ;; # equal files
- 1) $echo Test stdin-2 failed: files tstdin-2.out and $srcdir/tstdin-2.exp differ 1>&2;
+ 0) if test "$VERBOSE" ; then $echo passed minus-2; fi ;; # equal files
+ 1) $echo Test minus-2 failed: files tminus-2.out and $srcdir/tminus-2.exp differ 1>&2;
errors=`expr $errors + 1` ;;
- 2) $echo Test stdin-2 may have failed. 1>&2;
- $echo The command "cmp tstdin-2.out $srcdir/tstdin-2.exp" failed. 1>&2 ;
+ 2) $echo Test minus-2 may have failed. 1>&2;
+ $echo The command "cmp tminus-2.out $srcdir/tminus-2.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
-test -s tstdin-2.err || rm -f tstdin-2.err
+test -s tminus-2.err || rm -f tminus-2.err
$xx -n 10 < $srcdir/tn-1.in > tn-1.out 2> tn-1.err
code=$?
if test $code != 0 ; then
@@ -554,7 +588,7 @@ else
fi
test -s tn-5b.err || rm -f tn-5b.err
if test $errors = 0 ; then
- $echo Passed all 32 tests. 1>&2
+ $echo Passed all 34 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi