blob: 1bc23a097d7a172d58431dab755cb3a74fcbddc9 [file] [log] [blame]
Akrona8665782016-01-27 21:47:57 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Test::More;
6use Scalar::Util qw/weaken/;
7use Data::Dumper;
Akron151676d2016-03-14 20:12:14 +01008use lib 't/annotation';
Akrone4c2e412016-01-28 15:10:50 +01009use KorAP::XML::Krill;
Akrona8665782016-01-27 21:47:57 +010010use File::Basename 'dirname';
11use File::Spec::Functions 'catdir';
12
13
14my $path = catdir(dirname(__FILE__), 'corpus', 'doc', '0001');
15
Akrone4c2e412016-01-28 15:10:50 +010016ok(my $doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::XML::Krill');
Akrona8665782016-01-27 21:47:57 +010017ok($doc->parse, 'Parse document');
Nils Diewald0e489772016-10-24 15:16:52 +020018like($doc->path, qr!\Q$path\E/!, 'Path');
Akrona8665782016-01-27 21:47:57 +010019
20is($doc->primary->data,
21 'Zum letzten kulturellen Anlass lädt die Leitung des Schulheimes Hofbergli ein, '.
22 'bevor der Betrieb Ende Schuljahr eingestellt wird.', 'Primary data');
23
24is($doc->primary->data_length, 129, 'Primary data length');
25
26is($doc->primary->data(0,3), 'Zum', 'Get primary data');
27
28
29done_testing;
30
31__END__