| Akron | 430ada3 | 2016-01-07 13:49:34 +0100 | [diff] [blame] | 1 | #!/usr/bin/env perl |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | use utf8; |
| 5 | use Test::More; |
| 6 | use Scalar::Util qw/weaken/; |
| 7 | use Data::Dumper; |
| Akron | 151676d | 2016-03-14 20:12:14 +0100 | [diff] [blame] | 8 | use lib 't/annotation'; |
| Akron | 11ef51d | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 9 | use TestInit; |
| Akron | 430ada3 | 2016-01-07 13:49:34 +0100 | [diff] [blame] | 10 | |
| Akron | 11ef51d | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 11 | ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens'); |
| Akron | 430ada3 | 2016-01-07 13:49:34 +0100 | [diff] [blame] | 12 | |
| 13 | ok($tokens->add('Glemm', 'Morpho'), 'Add Structure'); |
| 14 | |
| 15 | my $data = $tokens->to_data->{data}; |
| 16 | |
| 17 | like($data->{foundries}, qr!glemm/morpho!, 'data'); |
| 18 | like($data->{layerInfos}, qr!glemm/l=tokens!, 'data'); |
| 19 | |
| Akron | dec4312 | 2020-03-03 11:22:25 +0100 | [diff] [blame] | 20 | is($data->{stream}->[0]->[1], '<>:base/s:t$<b>64<i>0<i>129<i>18<b>0', 'Text boundary'); |
| Akron | ee443f9 | 2016-02-25 23:56:49 +0100 | [diff] [blame] | 21 | is($data->{stream}->[0]->[3], 'glemm/l:__zu', 'Lemma'); |
| Akron | 430ada3 | 2016-01-07 13:49:34 +0100 | [diff] [blame] | 22 | is($data->{stream}->[1]->[1], 'glemm/l:__letzt-', 'Lemma'); |
| Akron | 126e33c | 2016-01-07 21:08:45 +0100 | [diff] [blame] | 23 | |
| Akron | 430ada3 | 2016-01-07 13:49:34 +0100 | [diff] [blame] | 24 | is($data->{stream}->[3]->[1], 'glemm/l:_+an-', 'Lemma'); |
| 25 | is($data->{stream}->[3]->[2], 'glemm/l:_+lass', 'Lemma'); |
| 26 | is($data->{stream}->[3]->[3], 'glemm/l:__Anlass', 'Lemma'); |
| 27 | |
| 28 | is($data->{stream}->[6]->[1], 'glemm/l:_+-ung', 'Lemma'); |
| 29 | is($data->{stream}->[6]->[2], 'glemm/l:_+leiten', 'Lemma'); |
| 30 | is($data->{stream}->[6]->[3], 'glemm/l:__Leitung', 'Lemma'); |
| 31 | |
| 32 | is($data->{stream}->[-1]->[1], 'glemm/l:__werden', 'Lemma'); |
| 33 | |
| 34 | done_testing; |
| 35 | |
| 36 | __END__ |