X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=blobdiff_plain;f=t%2Ftests.t;h=5f9661e5bb68ec74f3c15881d801849bbc0fde55;hp=9fa6fc3fe4f78f5cfd88a94e0a4a092f8d35ab1b;hb=4c5b4aedc1dcf125701393371013c47c35c7772b;hpb=5dd19bb96effb0b40c26bb669dd0f8ef176ebf40 diff --git a/t/tests.t b/t/tests.t index 9fa6fc3..5f9661e 100644 --- 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*] *..* -'; +' + : + 'Usage: + blhc [options] .. + +'); 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 . is_blhc '', '--help', 1, qr/^Usage: - blhc \[\*options\*\] \*\.\.\* + blhc \[\*?options\*?\] \*?\.\.\*? 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*] *..* - -'; + '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*] *..* - -'; + '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*] *..* - -'; + '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*] *..* - -'; + '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*] *..* - -'; + '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*] *..* - -'; + '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