]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - t/tests.t
Update t/tests.t for new output of Pod::Usage in 1.65
[blhc/blhc.git] / t / tests.t
index 9fa6fc3fe4f78f5cfd88a94e0a4a092f8d35ab1b..5f9661e5bb68ec74f3c15881d801849bbc0fde55 100644 (file)
--- a/t/tests.t
+++ b/t/tests.t
@@ -1,6 +1,6 @@
 # Tests for blhc.
 #
-# Copyright (C) 2012-2015  Simon Ruderich
+# Copyright (C) 2012-2016  Simon Ruderich
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -48,11 +48,17 @@ sub is_blhc {
 
 # Usage, invalid arguments.
 
-my $usage =
+use Pod::Usage;
+my $usage = ( $Pod::Usage::VERSION < 1.65 ?
         'Usage:
     blhc [*options*] *<dpkg-buildpackage build log file>..*
 
-';
+'
+    :
+        'Usage:
+    blhc [options] <dpkg-buildpackage build log file>..
+
+');
 is_blhc '', '--invalid', 2,
         "Unknown option: invalid\n"
         . $usage;
@@ -61,7 +67,7 @@ is_blhc '', '', 2,
         $usage;
 
 is_blhc '', '--version', 0,
-        'blhc 0.05  Copyright (C) 2012-2015  Simon Ruderich
+        'blhc 0.05  Copyright (C) 2012-2016  Simon Ruderich
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -79,7 +85,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 is_blhc '', '--help', 1,
         qr/^Usage:
-    blhc \[\*options\*\] \*<dpkg-buildpackage build log file>\.\.\*
+    blhc \[\*?options\*?\] \*?<dpkg-buildpackage build log file>\.\.\*?
 
 Options:
 /s;
@@ -118,23 +124,14 @@ is_blhc 'ignore-flag-ldflags', '--ignore-flag -fPIE', 0,
 
 # Invalid option.
 is_blhc 'ignore-flag', '--ignore-arch-flag -g', 2,
-        'Value "-g" invalid for option ignore-arch-flag ("arch:flag" expected)
-Usage:
-    blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+        'Value "-g" invalid for option ignore-arch-flag ("arch:flag" expected)'
+        . "\n$usage";
 is_blhc 'ignore-flag', '--ignore-arch-flag -g:', 2,
-        'Value "-g:" invalid for option ignore-arch-flag ("arch:flag" expected)
-Usage:
-    blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+        'Value "-g:" invalid for option ignore-arch-flag ("arch:flag" expected)'
+        . "\n$usage";
 is_blhc 'ignore-flag', '--ignore-arch-flag :amd64', 2,
-        'Value ":amd64" invalid for option ignore-arch-flag ("arch:flag" expected)
-Usage:
-    blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+        'Value ":amd64" invalid for option ignore-arch-flag ("arch:flag" expected)'
+        . "\n$usage";
 
 # Wrong architecture.
 is_blhc 'ignore-flag', '--ignore-arch-flag amd64:-g', 8,
@@ -181,23 +178,14 @@ is_blhc 'ignore-line', '--ignore-line "\./prepare-script gcc test-[a-z]\.c" --ig
 
 # Invalid option.
 is_blhc 'ignore-line', '--ignore-arch-line .+', 2,
-        'Value ".+" invalid for option ignore-arch-line ("arch:line" expected)
-Usage:
-    blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+        'Value ".+" invalid for option ignore-arch-line ("arch:line" expected)'
+        . "\n$usage";
 is_blhc 'ignore-line', '--ignore-arch-line .+:', 2,
-        'Value ".+:" invalid for option ignore-arch-line ("arch:line" expected)
-Usage:
-    blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+        'Value ".+:" invalid for option ignore-arch-line ("arch:line" expected)'
+        . "\n$usage";
 is_blhc 'ignore-line', '--ignore-arch-line :amd64', 2,
-        'Value ":amd64" invalid for option ignore-arch-line ("arch:line" expected)
-Usage:
-    blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+        'Value ":amd64" invalid for option ignore-arch-line ("arch:line" expected)'
+        . "\n$usage";
 
 # Wrong architecture.
 is_blhc 'ignore-line', '--ignore-arch-line "amd64:.+"', 8,
@@ -902,8 +890,8 @@ is_blhc 'debian-hardening-wrapper-pbuilder', '', 16,
 
 # false positives
 
-is_blhc 'false-positives', '', 1,
-        $empty;
+is_blhc 'false-positives', '', 0,
+        '';
 
 
 # buildd support