blob: 5ee9c58c43492a51545de7dc32c288376cc0ca03 [file] [log] [blame]
Marc Kupietzbb739b02020-09-22 16:49:34 +02001use strict;
2use warnings;
3use Test::More;
4use Test::Script;
5
6script_runs([ 'script/korapxml2conllu', '-h' ], { exit => 255 });
7script_stderr_like "Description", "Can print help message";
8
9for my $morpho_fname (glob("t/data/*\.*\.zip")) {
10 my $base_fname = $morpho_fname =~ s/(.*)\..*\.zip/$1.zip/r;
11 die "cannot find $base_fname" if (!-e $base_fname);
12
13 my $conllu_fname = $base_fname =~ s/(.*)\.zip/$1.conllu/r;
14 die "cannot find $conllu_fname" if (!-e $conllu_fname);
15
16 my $expected;
17 open(my $fh, '<', $conllu_fname) or die "cannot open file $conllu_fname"; {
18 local $/;
19 $expected = <$fh>;
20 }
21 close($fh);
22 script_runs([ 'script/korapxml2conllu', $morpho_fname ], "Runs with input");
23 script_stdout_is $expected, "Converts $morpho_fname correctly";
24}
25done_testing;