blob: 28d66bc726dbcdf6fe45ccbd81510c6d282d80f8 [file] [log] [blame]
Akrone2b902d2016-08-16 16:50:11 +02001#/usr/bin/env perl
2use strict;
3use warnings;
4use File::Basename 'dirname';
5use File::Spec::Functions qw/catdir catfile/;
6use File::Temp qw/ :POSIX /;
Akron5fd2d8e2017-06-19 15:29:39 +02007use Mojo::File;
Akrone2b902d2016-08-16 16:50:11 +02008use Mojo::JSON qw/decode_json/;
9use IO::Uncompress::Gunzip;
10use Test::More;
11use Test::Output;
12use Data::Dumper;
13
Akronfab17d32020-07-31 14:38:29 +020014if ($ENV{SKIP_SCRIPT}) {
15 plan skip_all => 'Skip script tests';
16};
17
Akrone2b902d2016-08-16 16:50:11 +020018my $f = dirname(__FILE__);
19my $script = catfile($f, '..', '..', 'script', 'korapxml2krill');
20ok(-f $script, 'Script found');
21
22stdout_like(
23 sub { system('perl', $script) },
24 qr!Usage.+?korapxml2krill!s,
25 'Usage output'
26);
27
28stdout_like(
29 sub { system('perl', $script, '--help') },
30 qr!Usage.+?korapxml2krill!s,
31 'Usage output'
32);
33
34stdout_like(
35 sub { system('perl', $script, '--version') },
36 qr!Version \d+\.\d+!s,
37 'Version output'
38);
39
40done_testing;
41__END__