blob: fab2bb5c46eaa4a0d4583128499633171c74543f [file] [log] [blame]
Akron126e33c2016-01-07 21:08:45 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
Akron14ca9f02016-01-29 19:38:18 +01005use Test::More; # skip_all => 'Not yet implemented';
Akron126e33c2016-01-07 21:08:45 +01006use Scalar::Util qw/weaken/;
7use Data::Dumper;
Akron11ef51d2016-01-18 19:07:56 +01008use lib 't/index';
9use TestInit;
Akron126e33c2016-01-07 21:08:45 +010010
Akron11ef51d2016-01-18 19:07:56 +010011ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akron126e33c2016-01-07 21:08:45 +010012
Akron14ca9f02016-01-29 19:38:18 +010013ok($tokens->add('Mate', 'Dependency'), 'Add Dependency');
Akron126e33c2016-01-07 21:08:45 +010014
Akron14ca9f02016-01-29 19:38:18 +010015my $data = $tokens->to_data->{data}->{stream};
Akron194be542016-01-21 12:52:43 +010016
Akron14ca9f02016-01-29 19:38:18 +010017# Unary relation
Akrone19aa142016-02-01 14:38:40 +010018is($data->[4]->[3], '<:mate/d:--$<b>32<i>4<s>1<s>1', '< rel 1 (unary)');
19is($data->[4]->[4], '>:mate/d:--$<b>32<i>4<s>1<s>1', '> rel 1 (unary)');
20is($data->[4]->[7], 'mate/d:NODE$<b>128<s>1', 'token for rel 1 (unary)');
Akron14ca9f02016-01-29 19:38:18 +010021
Akrone19aa142016-02-01 14:38:40 +010022is($data->[1]->[0], '>:mate/d:NK$<b>32<i>3<s>1<s>1', '> rel 2 (term-to-term)');
23is($data->[1]->[3], 'mate/d:NODE$<b>128<s>1', '< rel 2 (term-to-term)');
24is($data->[3]->[1], '<:mate/d:NK$<b>32<i>3<s>1<s>1', '< rel 2 (term-to-term)');
25is($data->[3]->[4], 'mate/d:NODE$<b>128<s>1', '< rel 2 (term-to-term)');
Akron126e33c2016-01-07 21:08:45 +010026
27done_testing;
28
29__END__
30