k2c: by default use s bounds from structure.xml
use --s-bounds-from-morpho option otherwise
Change-Id: Ic8321767d41416283dd5081620a1c07710fc3460
diff --git a/t/test.t b/t/test.t
index 648bf20..4fd8c6f 100644
--- a/t/test.t
+++ b/t/test.t
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 33;
+use Test::More tests => 37;
use Test::Script;
use Test::TempDir::Tiny;
use File::Copy;
@@ -34,6 +34,32 @@
script_stdout_is $expected, "Converts $morpho_fname correctly";
}
+for my $morpho_fname (glob("t/data/*\.*\.zip")) {
+ my $base_fname = $morpho_fname =~ s/(.*)\..*\.zip/$1.zip/r;
+ if (!-e $base_fname) {
+ fail("cannot find $base_fname");
+ next;
+ };
+
+ my $conllu_fname = $base_fname =~ s/(.*)\.zip/$1.morpho.sbfm.conllu/r;
+ if (!-e $conllu_fname) {
+ fail("cannot find $conllu_fname");
+ next;
+ };
+
+ my $expected;
+ if (open(my $fh, '<', $conllu_fname)) {
+ local $/;
+ $expected = <$fh>;
+ close($fh);
+ } else {
+ fail("cannot open file $conllu_fname");
+ next;
+ }
+ script_runs([ 'script/korapxml2conllu', '--s-bounds-from-morpho', $morpho_fname ], "Runs korapxml2conllu with --s-bounds-from-morpho correctly");
+ script_stdout_is $expected, "Converts $morpho_fname correctly";
+}
+
for my $base_fname (glob("t/data/*\.zip")) {
my $conllu_fname = $base_fname =~ s/(.*)\.zip/$1.conllu/r;
next if (!-e $conllu_fname);