summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-11-01 23:05:52 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-11-01 23:05:52 +0000
commit407fb46c87ff8e9c7fe8c9eb7cddd5561c97461e (patch)
treeb134aa5ee2725a2972a3be68828b67717854da1c
parent99f09784cc98732a440de86bb99a46f11f7355d8 (diff)
downloadcoreutils-407fb46c87ff8e9c7fe8c9eb7cddd5561c97461e.tar.xz
(c-2, c-2-minus, c2, c2-minus): New tests.
(test_vector): Add special cases for _POSIX2_VERSION, and regularize the old ones a bit.
-rwxr-xr-xtests/tail/Test.pm19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/tail/Test.pm b/tests/tail/Test.pm
index c9c38c7de..354b4f9c1 100755
--- a/tests/tail/Test.pm
+++ b/tests/tail/Test.pm
@@ -58,6 +58,11 @@ my @tv = (
['minus-1', '-', '', '', 0],
['minus-2', '-', "x\n" . ("y\n" x 10) . 'z', ("y\n" x 9) . 'z', 0],
+['c-2', '-c 2', "abcd\n", "d\n", 0],
+['c-2-minus', '-c 2 --', "abcd\n", "d\n", 0],
+['c2', '-c2', "abcd\n", "d\n", 0],
+['c2-minus', '-c2 --', "abcd\n", "d\n", 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],
['n-3', '-n +10', "x\n" . ("y\n" x 10) . 'z', "y\ny\nz", 0],
@@ -78,17 +83,19 @@ my @tv = (
sub test_vector
{
- # With _POSIX2_VERSION=199209, `tail -c' succeeds, but err-6 expects
- # a failure, so set _POSIX2_VERSION to ensure it fails.
- $Test::env{'err-6'} = ['_POSIX2_VERSION=200112'];
-
my $t;
foreach $t (@tv)
{
my ($test_name, $flags, $in, $exp, $ret) = @$t;
- $test_name =~ /^(obs-plus-|minus-)/
- and $Test::env{$test_name} = ['_POSIX2_VERSION=199209'];
+ if ($test_name =~ /^(obs-plus-|minus-)/)
+ {
+ $Test::env{$test_name} = ['_POSIX2_VERSION=199209'];
+ }
+ if ($test_name =~ /^(err-6|c-2)$/)
+ {
+ $Test::env{$test_name} = ['_POSIX2_VERSION=200112'];
+ }
# If you run the minus* tests with a FILE arg they'd hang.
# If you run the err-1 or err-3 tests with a FILE, they'd misinterpret