Akron | b27f694 | 2015-12-09 22:34:26 +0100 | [diff] [blame] | 1 | #!/usr/bin/env perl |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | use utf8; |
| 5 | use Test::More; |
Akron | 5c460e4 | 2016-03-14 20:12:14 +0100 | [diff] [blame^] | 6 | use lib 't/annotation'; |
Akron | b5d3461 | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 7 | use TestInit; |
Akron | b27f694 | 2015-12-09 22:34:26 +0100 | [diff] [blame] | 8 | use Scalar::Util qw/weaken/; |
Akron | 35ed2f5 | 2015-12-10 00:40:20 +0100 | [diff] [blame] | 9 | use Data::Dumper; |
Akron | b27f694 | 2015-12-09 22:34:26 +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 | b27f694 | 2015-12-09 22:34:26 +0100 | [diff] [blame] | 12 | |
| 13 | ok($tokens->add('Base', 'Paragraphs'), 'Add Structure'); |
| 14 | |
Akron | 35ed2f5 | 2015-12-10 00:40:20 +0100 | [diff] [blame] | 15 | my $data = $tokens->to_data->{data}; |
| 16 | |
| 17 | like($data->{foundries}, qr!base/paragraphs!, 'data'); |
| 18 | is($data->{stream}->[0]->[0], '-:base/paragraphs$<i>1', 'Number of paragraphs'); |
| 19 | is($data->{stream}->[0]->[1], '-:tokens$<i>18', 'Number of tokens'); |
Akron | f6b2041 | 2016-02-25 23:56:49 +0100 | [diff] [blame] | 20 | is($data->{stream}->[0]->[2], '<>:base/s:t$<b>64<i>0<i>129<i>17<b>0', 'Text'); |
| 21 | is($data->{stream}->[0]->[3], '<>:base/s:p$<b>64<i>0<i>129<i>17<b>1', 'Paragraph'); |
| 22 | is($data->{stream}->[0]->[4], '_0$<i>0<i>3', 'Position'); |
Akron | b27f694 | 2015-12-09 22:34:26 +0100 | [diff] [blame] | 23 | |
| 24 | done_testing; |
| 25 | |
| 26 | __END__ |