Akron | a10ad59 | 2020-08-03 11:20:23 +0200 | [diff] [blame] | 1 | use strict; |
| 2 | use warnings; |
| 3 | use Test::More; |
| 4 | use Test::XML::Loy; |
| 5 | |
| 6 | use_ok('KorAP::XML::TEI::Data'); |
| 7 | |
| 8 | my $d = KorAP::XML::TEI::Data->new; |
| 9 | |
| 10 | ok($d, 'Constructed'); |
| 11 | |
| 12 | is($d->position, 0, 'Position'); |
| 13 | ok($d->append('aaa'), 'Add raw data'); |
| 14 | is($d->position, 3, 'Position'); |
| 15 | ok($d->reset, 'Reset'); |
| 16 | is($d->position, 0, 'Position'); |
| 17 | |
| 18 | |
| 19 | ok($d->append(' Dies ist '), 'Add raw data'); |
| 20 | is($d->position, 11, 'Position'); |
| 21 | ok($d->append("Ein Versuch\n"), 'Add raw data'); |
| 22 | is($d->position, 23, 'Position'); |
| 23 | |
| 24 | my $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 | |
| 29 | done_testing; |