Add ability to convert KorAP-XML base zips to CoNLL-U
Change-Id: I7ed7dc4a1f86769076b91247cfbdd408b7539641
diff --git a/t/test.t b/t/test.t
index 5ee9c58..becc3cd 100644
--- a/t/test.t
+++ b/t/test.t
@@ -10,7 +10,7 @@
my $base_fname = $morpho_fname =~ s/(.*)\..*\.zip/$1.zip/r;
die "cannot find $base_fname" if (!-e $base_fname);
- my $conllu_fname = $base_fname =~ s/(.*)\.zip/$1.conllu/r;
+ my $conllu_fname = $base_fname =~ s/(.*)\.zip/$1.morpho.conllu/r;
die "cannot find $conllu_fname" if (!-e $conllu_fname);
my $expected;
@@ -22,4 +22,21 @@
script_runs([ 'script/korapxml2conllu', $morpho_fname ], "Runs with input");
script_stdout_is $expected, "Converts $morpho_fname correctly";
}
+
+for my $base_fname (glob("t/data/*\.zip")) {
+ next if($base_fname = ~ /\..*}./); # skip tagged files like goe.tree_tagger.zip
+
+ my $conllu_fname = $base_fname =~ s/(.*)\.zip/$1.conllu/r;
+ die "cannot find $conllu_fname" if (!-e $conllu_fname);
+
+ my $expected;
+ open(my $fh, '<', $conllu_fname) or die "cannot open file $conllu_fname"; {
+ local $/;
+ $expected = <$fh>;
+ }
+ close($fh);
+ script_runs([ 'script/korapxml2conllu', $base_fname ], "Runs with input");
+ script_stdout_is $expected, "Converts $base_fname correctly";
+}
+
done_testing;
\ No newline at end of file