Add deflist generation

Change-Id: I28282a23e0fee65191db6f45d87a02664a19acdf
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__
+
+