blob: 7e606ba9e56345edb3606b8d83abf39717532e76 [file] [log] [blame]
Akron1622dd92015-12-09 22:34:26 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Test::More;
Akron11ef51d2016-01-18 19:07:56 +01006use lib 't/index';
7use TestInit;
Akron1622dd92015-12-09 22:34:26 +01008use Scalar::Util qw/weaken/;
Akrond69836b2015-12-10 00:40:20 +01009use Data::Dumper;
Akron1622dd92015-12-09 22:34:26 +010010
Akron11ef51d2016-01-18 19:07:56 +010011ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akron1622dd92015-12-09 22:34:26 +010012
13ok($tokens->add('Base', 'Paragraphs'), 'Add Structure');
14
Akrond69836b2015-12-10 00:40:20 +010015my $data = $tokens->to_data->{data};
16
17like($data->{foundries}, qr!base/paragraphs!, 'data');
18is($data->{stream}->[0]->[0], '-:base/paragraphs$<i>1', 'Number of paragraphs');
19is($data->{stream}->[0]->[1], '-:tokens$<i>18', 'Number of tokens');
20is($data->{stream}->[0]->[2], '<>:base/s:p$<b>64<i>0<i>129<i>17<b>1', 'Paragraph');
21is($data->{stream}->[0]->[3], '_0$<i>0<i>3', 'Position');
Akron1622dd92015-12-09 22:34:26 +010022
23done_testing;
24
25__END__