1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-18 01:18:51 +02:00

(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.
This commit is contained in:
Paul Eggert
2005-11-01 23:05:52 +00:00
parent 99f09784cc
commit 407fb46c87
+13 -6
View File
@@ -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