blob: e42453c27cfb837ccbdd7d5d0f91174178c045ad [file] [log] [blame]
Akron9d8cbc52016-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;
8use lib 't/index';
Akron8fa76bc2016-01-28 15:10:50 +01009use KorAP::XML::Krill;
Akron9d8cbc52016-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
Akron8fa76bc2016-01-28 15:10:50 +010016ok(my $doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::XML::Krill');
Akron9d8cbc52016-01-27 21:47:57 +010017ok($doc->parse, 'Parse document');
18like($doc->path, qr!$path/!, 'Path');
19
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__