X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=blobdiff_plain;f=t%2Ftests.t;h=d41fad9bc9410dd3e77407df9174c037ba46fc8e;hp=0641e45241a61834eca143c8a846ee832a2088ea;hb=9395672628a14a9064e0b049fbc0aa6f83544fb0;hpb=c494af03207cb214ba87057bf296c195e357686e diff --git a/t/tests.t b/t/tests.t index 0641e45..d41fad9 100644 --- a/t/tests.t +++ b/t/tests.t @@ -19,7 +19,7 @@ use strict; use warnings; -use Test::More tests => 182; +use Test::More tests => 190; sub is_blhc { @@ -38,7 +38,11 @@ sub is_blhc { $options = ' '. $options; } is $? >> 8, $exit, "$file$options (exit code)"; - is $output, $expected, "$file$options (output)"; + # Perform regex or string match. + my $cmd = (ref $expected eq 'Regexp') + ? \&like + : \&is; + &$cmd($output, $expected, "$file$options (output)"); } @@ -73,6 +77,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . '; +is_blhc '', '--help', 1, + qr/^Usage: + blhc \[\*options\*\] \*\.\.\* + +Options: +/s; + +is_blhc 'doesnt-exist', '', 2, + qr{^No such file or directory at \./bin/blhc line \d+\.$}; + # No compiler commands found. @@ -114,6 +128,12 @@ is_blhc 'ignore-flag', '--ignore-arch-flag -g:', 2, Usage: blhc [*options*] *..* +'; +is_blhc 'ignore-flag', '--ignore-arch-flag :amd64', 2, + 'Value ":amd64" invalid for option ignore-arch-flag ("arch:flag" expected) +Usage: + blhc [*options*] *..* + '; # Wrong architecture. @@ -171,6 +191,12 @@ is_blhc 'ignore-line', '--ignore-arch-line .+:', 2, Usage: blhc [*options*] *..* +'; +is_blhc 'ignore-line', '--ignore-arch-line :amd64', 2, + 'Value ":amd64" invalid for option ignore-arch-line ("arch:line" expected) +Usage: + blhc [*options*] *..* + '; # Wrong architecture.