Add extract_sigle method to archive
Change-Id: Ic2eb6578c6e8fb57e2191f685a000fd712ec463d
diff --git a/t/script/archive.t b/t/script/archive.t
index 8d0fba1..290784b 100644
--- a/t/script/archive.t
+++ b/t/script/archive.t
@@ -38,7 +38,6 @@
my $input = catfile($f, '..', 'corpus', 'archive.zip');
ok(-f $input, 'Input archive found');
-
my $output = File::Temp->newdir(CLEANUP => 0);
$output->unlink_on_destroy(0);
@@ -221,5 +220,38 @@
$call
);
+
+
+# Test with sigles
+$input = catfile($f, '..', 'corpus', 'archive.zip');
+ok(-f $input, 'Input archive found');
+
+unlink($output);
+
+$call = join(
+ ' ',
+ 'perl', $script,
+ 'archive',
+ '--input' => '' . $input,
+ '--output' => $output,
+ '--sigle' => 'TEST/BSP/2',
+ '--sigle' => 'TEST/BSP/5',
+ '-t' => 'Base#tokens_aggr',
+ '-m' => 'Sgbr'
+);
+
+{
+ local $SIG{__WARN__} = sub {};
+ my $out = stdout_from(sub { system($call); });
+
+ like($out, qr!TEST-BSP-1\.json!s, $call);
+
+ $out =~ m!Processed (.+?\.json)!;
+ $json = $1;
+};
+
+ok(-f $json, 'Json file exists');
+
+
done_testing;
__END__
diff --git a/t/script/extract.t b/t/script/extract.t
index e9f666f..11d7cf3 100644
--- a/t/script/extract.t
+++ b/t/script/extract.t
@@ -167,7 +167,7 @@
sub {
system($call);
},
- qr!Extract .+? REI/BN\*!s,
+ qr!Extract .+? REI/BN!s,
$call
);