blob: b9f5a66b2e37724c2d63c2ad454c9337cdd1d5d1 [file] [log] [blame]
Akron5f511d22016-01-05 20:54:34 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Test::More;
6use Scalar::Util qw/weaken/;
7use Data::Dumper;
Akron11ef51d2016-01-18 19:07:56 +01008use lib 't/index';
9use TestInit;
Akron5f511d22016-01-05 20:54:34 +010010
Akron11ef51d2016-01-18 19:07:56 +010011ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akron5f511d22016-01-05 20:54:34 +010012
13ok($tokens->add('XIP', 'Sentences'), 'Add Structure');
14
15my $data = $tokens->to_data->{data};
16
17like($data->{foundries}, qr!xip/sentences!, 'data');
18
19is($data->{stream}->[0]->[1], '-:xip/sentences$<i>1', 'Number of paragraphs');
20is($data->{stream}->[0]->[0], '-:tokens$<i>18', 'Number of tokens');
21is($data->{stream}->[0]->[2], '<>:xip/s:s$<b>64<i>0<i>129<i>17<b>0', 'Text');
22is($data->{stream}->[0]->[3], '_0$<i>0<i>3', 'Position');
23is($data->{stream}->[-1]->[0], '_17$<i>124<i>128', 'Position');
24
25done_testing;
26__END__