Add deflist generation

Change-Id: I28282a23e0fee65191db6f45d87a02664a19acdf
diff --git a/t/data/list-example.ls b/t/data/list-example.ls
index 6878eef..4426046 100644
--- a/t/data/list-example.ls
+++ b/t/data/list-example.ls
@@ -14,7 +14,7 @@
 thm-lit	Belletristik/Trivialliteratur: Thomas-Mann-Korpus	THM/(AMB|AMD|AME|AMF|AMH|AMJ|AMK|AML|AMN|AMZ)
 wxx11	Wikipedia Artikel und Diskussionen	W[PD]D11/
 zca	Zeit Campus (Feb.-Apr.;Jun.;Aug.;Okt.-Dez.; Dez. 2013 n.v.)	ZCA[0-9][0-9]/
-corp-w-gesamt.2023-i.16.03.23	@COPY@
-corp-a	@COPY@
+list2	@COPY@
+list5	@COPY@
 misc-lit	Belletristik/Trivialliteratur (öffentlich)	(GOE/(AGD|AGM|AGN|AGV|AGW))|(MK1/(LBC|LBT|LFH|LGB|LJA|LMB|LSO|MHE|TJM|TPM))|(MK2/TRI)
 
diff --git a/t/data/list5.def.bz2 b/t/data/list5.def.bz2
new file mode 100644
index 0000000..d5215b8
--- /dev/null
+++ b/t/data/list5.def.bz2
Binary files differ
diff --git a/t/list2vc-deflist.t b/t/list2vc-deflist.t
index 41c2176..89577fb 100644
--- a/t/list2vc-deflist.t
+++ b/t/list2vc-deflist.t
@@ -5,24 +5,60 @@
 use File::Basename;
 use File::Spec::Functions;
 use Data::Dumper;
+use File::Temp qw/tempdir/;
 
 use Test::Output;
 use Mojo::JSON 'decode_json';
 
 my $script = catfile(dirname(__FILE__), '..', 'script', 'cosmasvc2koralquery');
+my $copysrc = catdir(dirname(__FILE__), 'data');
 my $list1 = catfile(dirname(__FILE__), 'data', 'list-example.ls');
+my $output = tempdir( CLEANUP => 1 );
+
+my @call = ($script, 'list', $list1, '--copy-src', $copysrc, '--output', $output);
 
 # Check STDOUT
-stdout_like(
+stderr_like(
   sub {
-    system($script, 'list', $list1);
+    system(@call);
   },
-  qr!Convert!,
+  qr!redabs is not yet supported!,
   "check stdout"
 );
 
 # Check JSON
-# my $protocol = join('', `$script list $list1`);
+my $protocol = join('', `@call`);
+
+like($protocol, qr!bih from regex!);
+ok(-f catfile($output, 'bih.json'));
+like($protocol, qr!bio from regex!);
+ok(-f catfile($output, 'bio.json'));
+like($protocol, qr!bio-pub from regex!);
+ok(-f catfile($output, 'bio-pub.json'));
+like($protocol, qr!l from regex!);
+ok(-f catfile($output, 'l.json'));
+like($protocol, qr!dpa from regex!);
+ok(-f catfile($output, 'dpa.json'));
+like($protocol, qr!fsp from regex!);
+ok(-f catfile($output, 'fsp.json'));
+like($protocol, qr!fsp-pub from regex!);
+ok(-f catfile($output, 'fsp-pub.json'));
+like($protocol, qr!kjl from regex!);
+ok(-f catfile($output, 'kjl.json'));
+like($protocol, qr!thm-lit from regex!);
+ok(-f catfile($output, 'thm-lit.json'));
+like($protocol, qr!wxx11 from regex!);
+ok(-f catfile($output, 'wxx11.json'));
+like($protocol, qr!zca from regex!);
+ok(-f catfile($output, 'zca.json'));
+like($protocol, qr!list2 from def-file!);
+ok(-f catfile($output, 'list2.json'));
+like($protocol, qr!list5 from def-file!);
+ok(-f catfile($output, 'list5.json'));
+like($protocol, qr!misc-lit from regex!);
+ok(-f catfile($output, 'misc-lit.json'));
 
 done_testing;
 __END__
+
+