blob: 2f993646573ae89a6dac18a5dc7f80f3e240e4b9 [file] [log] [blame]
Akron84b53ad2022-01-14 12:39:15 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use Data::Dumper;
5use Test::More;
6use File::Temp 'tempfile';
7use File::Basename 'dirname';
8use File::Spec::Functions qw!catdir catfile!;
9
10use_ok('KorAP::XML::Log::Slim');
11
12my $temp = tempfile();
13
14my $file = catfile(dirname(__FILE__), 'logs','dereko-example-log.txt');
15
16ok(!KorAP::XML::Log::Slim->new);
17
18my $slim = KorAP::XML::Log::Slim->new($file);
19
20$slim->slim_to($temp);
21
22seek($temp, 0,0);
23
24my $content;
25{
26 local $/;
27 $content = <$temp>;
28}
29
30like($content, qr!2 Start serial processing of e03\.\*zip!);
31unlike($content, qr!Convert \[[^:]+?\:2\/\d+?\] Processed!);
32unlike($content, qr!Unable to process!);
33like($content, qr!Use of uninitialized value!);
34like($content, qr!End-of-central-directory!);
35like($content, qr!## Done\. \[\!Process\: 1\]!);
36like($content, qr!file #1: bad zipfile offset!);
37like($content, qr!cannot find zipfile directory!);
38
39done_testing;