diff options
Diffstat (limited to 'tests/pr')
-rw-r--r-- | tests/pr/Test.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/pr/Test.pm b/tests/pr/Test.pm index 8512bbf70..066212d44 100644 --- a/tests/pr/Test.pm +++ b/tests/pr/Test.pm @@ -346,6 +346,15 @@ my @tv = ( # This test would fail with textutils-2.1 and earlier. ['col-last', '-W3 -t2', "a\nb\nc\n", "a c\nb\n", 0], +# Make sure that -02 is treated just like -2. +['col-02', '-W3 -t -02', "a\nb\nc\n", "a c\nb\n", 0], +# The -2 must override preceding column-count-specifying options. +['col-2', '-W3 -t -4 --columns=1 -2', "a\nb\nc\n", "a c\nb\n", 0], +# The --columns=2 must override preceding column-count-specifying options. +['col-long', '-W3 -t -1 --columns=2', "a\nb\nc\n", "a c\nb\n", 0], +# Make sure these fail. +['col-0', '-0', '', '', 1], +['col-inval', '-'.'9'x100, '', '', 1], ); #']]); @@ -364,6 +373,7 @@ sub test_vector $flags = "$common_option_prefix$sep$flags"; push (@new_tv, [$test_name, $flags, $in, $exp, $ret]); + # For any use of -N, create an identical test with --columns=N. (my $new_flags = $flags) =~ s/(^| )-(\d+)( |$)/$1--columns=$2$3/g; $new_flags ne $flags and push (@new_tv, ["$test_name.C", $new_flags, $in, $exp, $ret]); |