mirror of
https://github.com/coreutils/coreutils.git
synced 2024-12-12 19:34:40 +08:00
Use test_vector, not array @t.
This commit is contained in:
parent
dcd02c8008
commit
1b47ed2714
@ -2,27 +2,26 @@ package Test;
|
||||
require 5.002;
|
||||
use strict;
|
||||
|
||||
my $nl = "\n";
|
||||
@Test::t = (
|
||||
my @tv = (
|
||||
# test flags input expected output expected return code
|
||||
#
|
||||
['1', '-d: -f1,3-', "a:b:c$nl", "a:c\n", 0],
|
||||
['1', '-d: -f1,3-', "a:b:c\n", "a:c\n", 0],
|
||||
['2', '-d: -f1,3-', "a:b:c\n", "a:c\n", 0],
|
||||
['3', '-d: -f2-', "a:b:c$nl", "b:c\n", 0],
|
||||
['4', '-d: -f4', "a:b:c$nl", "\n", 0],
|
||||
['3', '-d: -f2-', "a:b:c\n", "b:c\n", 0],
|
||||
['4', '-d: -f4', "a:b:c\n", "\n", 0],
|
||||
['5', '-d: -f4', "", "", 0],
|
||||
['6', '-c4', "123$nl", "\n", 0],
|
||||
['6', '-c4', "123\n", "\n", 0],
|
||||
['7', '-c4', "123", "\n", 0],
|
||||
['8', '-c4', "123\n1", "\n\n", 0],
|
||||
['9', '-c4', "", "", 0],
|
||||
['a', '-s -d: -f3-', "a:b:c$nl", "c\n", 0],
|
||||
['b', '-s -d: -f2,3', "a:b:c$nl", "b:c\n", 0],
|
||||
['c', '-s -d: -f1,3', "a:b:c$nl", "a:c\n", 0],
|
||||
['a', '-s -d: -f3-', "a:b:c\n", "c\n", 0],
|
||||
['b', '-s -d: -f2,3', "a:b:c\n", "b:c\n", 0],
|
||||
['c', '-s -d: -f1,3', "a:b:c\n", "a:c\n", 0],
|
||||
# Trailing colon should not be output
|
||||
['d', '-s -d: -f1,3', "a:b:c:$nl", "a:c\n", 0],
|
||||
['e', '-s -d: -f3-', "a:b:c:$nl", "c:\n", 0],
|
||||
['f', '-s -d: -f3-4', "a:b:c:$nl", "c:\n", 0],
|
||||
['g', '-s -d: -f3,4', "a:b:c:$nl", "c:\n", 0],
|
||||
['d', '-s -d: -f1,3', "a:b:c:\n", "a:c\n", 0],
|
||||
['e', '-s -d: -f3-', "a:b:c:\n", "c:\n", 0],
|
||||
['f', '-s -d: -f3-4', "a:b:c:\n", "c:\n", 0],
|
||||
['g', '-s -d: -f3,4', "a:b:c:\n", "c:\n", 0],
|
||||
# Make sure -s suppresses non-delimited lines
|
||||
['h', '-s -d: -f2,3', "abc\n", "", 0],
|
||||
#
|
||||
@ -59,4 +58,9 @@ my $nl = "\n";
|
||||
['D', '-b', ":\n", "", 1],
|
||||
);
|
||||
|
||||
sub test_vector
|
||||
{
|
||||
return @tv;
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -2,7 +2,7 @@ package Test;
|
||||
require 5.002;
|
||||
use strict;
|
||||
|
||||
@Test::t = (
|
||||
my @tv = (
|
||||
# test name
|
||||
# flags file-1 file-2 expected output expected return code
|
||||
#
|
||||
@ -90,8 +90,12 @@ use strict;
|
||||
"a .\nb .\nc .\nd G\ne .\n", 0],
|
||||
|
||||
# From David Dyck
|
||||
['9a', '',
|
||||
[" a 1\n b 2\n", " a Y\n b Z\n"], "a 1 Y\nb 2 Z\n", 0],
|
||||
['9a', '', [" a 1\n b 2\n", " a Y\n b Z\n"], "a 1 Y\nb 2 Z\n", 0],
|
||||
);
|
||||
|
||||
sub test_vector
|
||||
{
|
||||
return @tv;
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -3,7 +3,7 @@ package Test;
|
||||
require 5.002;
|
||||
use strict;
|
||||
|
||||
@Test::t = (
|
||||
my @tv = (
|
||||
#test options input expected-output expected-return-code
|
||||
#
|
||||
["01a", '', "A\nB\nC\n", "A\nB\nC\n", 0],
|
||||
@ -151,4 +151,9 @@ use strict;
|
||||
|
||||
);
|
||||
|
||||
sub test_vector
|
||||
{
|
||||
return @tv;
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -4,7 +4,7 @@ use strict;
|
||||
|
||||
$Test::input_via_stdin = 1;
|
||||
|
||||
@Test::t = (
|
||||
my @tv = (
|
||||
# test flags 1 or 2 strings input expected output expected return code
|
||||
#
|
||||
['1', q|'abcd' '[]*]'|, 'abcd', ']]]]', 0],
|
||||
@ -97,4 +97,9 @@ $Test::input_via_stdin = 1;
|
||||
['R6', '-dc ' . q|'[:upper:]'|, '', '', 0],
|
||||
);
|
||||
|
||||
sub test_vector
|
||||
{
|
||||
return @tv;
|
||||
}
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user