blob: 06a2ce5929f7dec9bca26dfc83e4d203f5c7f18f [file] [log] [blame]
Akrond99f8c82016-01-07 21:08:45 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
Akron516753c2016-02-26 14:07:58 +01005use Test::More;
Akrond99f8c82016-01-07 21:08:45 +01006use Scalar::Util qw/weaken/;
7use Data::Dumper;
Akronb5d34612016-01-18 19:07:56 +01008use lib 't/index';
9use TestInit;
Akrond99f8c82016-01-07 21:08:45 +010010
Akronb5d34612016-01-18 19:07:56 +010011ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akrond99f8c82016-01-07 21:08:45 +010012
Akron627a80a2016-01-29 19:38:18 +010013ok($tokens->add('Mate', 'Dependency'), 'Add Dependency');
Akrond99f8c82016-01-07 21:08:45 +010014
Akron627a80a2016-01-29 19:38:18 +010015my $data = $tokens->to_data->{data}->{stream};
Akronb1f7dcc2016-01-21 12:52:43 +010016
Akron627a80a2016-01-29 19:38:18 +010017# Unary relation
Akron63cad162016-02-02 23:36:52 +010018is($data->[4]->[2], '<:mate/d:--$<b>32<i>4<s>1<s>1', '< rel 1 (unary)');
19is($data->[4]->[1], '>:mate/d:--$<b>32<i>4<s>1<s>1', '> rel 1 (unary)');
Akron516753c2016-02-26 14:07:58 +010020is($data->[4]->[8], 'mate/d:&&&$<b>128<s>1', 'token for rel 1 (unary)');
Akron627a80a2016-01-29 19:38:18 +010021
Akrona7d9adf2016-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)');
Akron516753c2016-02-26 14:07:58 +010023is($data->[1]->[3], 'mate/d:&&&$<b>128<s>1', '< rel 2 (term-to-term)');
Akron63cad162016-02-02 23:36:52 +010024is($data->[3]->[1], '<:mate/d:NK$<b>32<i>1<s>1<s>1', '< rel 2 (term-to-term)');
Akron516753c2016-02-26 14:07:58 +010025is($data->[3]->[5], 'mate/d:&&&$<b>128<s>1', '< rel 2 (term-to-term)');
26
Akrond99f8c82016-01-07 21:08:45 +010027
28done_testing;
29
30__END__
31
Akron516753c2016-02-26 14:07:58 +010032
33