blob: b33c6415602f957ae767b0129b673182b1216ac6 [file] [log] [blame]
Akrona10ad592020-08-03 11:20:23 +02001use strict;
2use warnings;
3use Test::More;
4use Test::XML::Loy;
5
6use_ok('KorAP::XML::TEI::Data');
7
8my $d = KorAP::XML::TEI::Data->new;
9
10ok($d, 'Constructed');
11
12is($d->position, 0, 'Position');
13ok($d->append('aaa'), 'Add raw data');
14is($d->position, 3, 'Position');
15ok($d->reset, 'Reset');
16is($d->position, 0, 'Position');
17
18
19ok($d->append(' Dies ist '), 'Add raw data');
20is($d->position, 11, 'Position');
21ok($d->append("Ein Versuch\n"), 'Add raw data');
22is($d->position, 23, 'Position');
23
24my $loy = Test::XML::Loy->new($d->to_string('x'));
25
26$loy->attr_is('raw_text', 'docid', 'x')
27 ->text_is('raw_text text', ' Dies ist Ein Versuch ');
28
29done_testing;