Akron | ca9dbb3 | 2016-01-05 20:54: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 | b5d3461 | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 8 | use lib 't/index'; |
| 9 | use TestInit; |
Akron | ca9dbb3 | 2016-01-05 20:54:34 +0100 | [diff] [blame] | 10 | |
Akron | b5d3461 | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 11 | ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens'); |
Akron | ca9dbb3 | 2016-01-05 20:54:34 +0100 | [diff] [blame] | 12 | |
| 13 | ok($tokens->add('XIP', 'Sentences'), 'Add Structure'); |
| 14 | |
| 15 | my $data = $tokens->to_data->{data}; |
| 16 | |
| 17 | like($data->{foundries}, qr!xip/sentences!, 'data'); |
| 18 | |
| 19 | is($data->{stream}->[0]->[1], '-:xip/sentences$<i>1', 'Number of paragraphs'); |
| 20 | is($data->{stream}->[0]->[0], '-:tokens$<i>18', 'Number of tokens'); |
| 21 | is($data->{stream}->[0]->[2], '<>:xip/s:s$<b>64<i>0<i>129<i>17<b>0', 'Text'); |
| 22 | is($data->{stream}->[0]->[3], '_0$<i>0<i>3', 'Position'); |
| 23 | is($data->{stream}->[-1]->[0], '_17$<i>124<i>128', 'Position'); |
| 24 | |
| 25 | done_testing; |
| 26 | __END__ |