Akron | d99f8c8 | 2016-01-07 21:08:45 +0100 | [diff] [blame] | 1 | #!/usr/bin/env perl |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | use utf8; |
Akron | 627a80a | 2016-01-29 19:38:18 +0100 | [diff] [blame] | 5 | use Test::More; # skip_all => 'Not yet implemented'; |
Akron | d99f8c8 | 2016-01-07 21:08:45 +0100 | [diff] [blame] | 6 | use Scalar::Util qw/weaken/; |
| 7 | use Data::Dumper; |
Akron | b5d3461 | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 8 | use lib 't/index'; |
| 9 | use TestInit; |
Akron | d99f8c8 | 2016-01-07 21:08:45 +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 | d99f8c8 | 2016-01-07 21:08:45 +0100 | [diff] [blame] | 12 | |
Akron | 627a80a | 2016-01-29 19:38:18 +0100 | [diff] [blame] | 13 | ok($tokens->add('Mate', 'Dependency'), 'Add Dependency'); |
Akron | d99f8c8 | 2016-01-07 21:08:45 +0100 | [diff] [blame] | 14 | |
Akron | 627a80a | 2016-01-29 19:38:18 +0100 | [diff] [blame] | 15 | my $data = $tokens->to_data->{data}->{stream}; |
Akron | b1f7dcc | 2016-01-21 12:52:43 +0100 | [diff] [blame] | 16 | |
Akron | 627a80a | 2016-01-29 19:38:18 +0100 | [diff] [blame] | 17 | # Unary relation |
Akron | a7d9adf | 2016-02-01 14:38:40 +0100 | [diff] [blame^] | 18 | is($data->[4]->[3], '<:mate/d:--$<b>32<i>4<s>1<s>1', '< rel 1 (unary)'); |
| 19 | is($data->[4]->[4], '>:mate/d:--$<b>32<i>4<s>1<s>1', '> rel 1 (unary)'); |
| 20 | is($data->[4]->[7], 'mate/d:NODE$<b>128<s>1', 'token for rel 1 (unary)'); |
Akron | 627a80a | 2016-01-29 19:38:18 +0100 | [diff] [blame] | 21 | |
Akron | a7d9adf | 2016-02-01 14:38:40 +0100 | [diff] [blame^] | 22 | is($data->[1]->[0], '>:mate/d:NK$<b>32<i>3<s>1<s>1', '> rel 2 (term-to-term)'); |
| 23 | is($data->[1]->[3], 'mate/d:NODE$<b>128<s>1', '< rel 2 (term-to-term)'); |
| 24 | is($data->[3]->[1], '<:mate/d:NK$<b>32<i>3<s>1<s>1', '< rel 2 (term-to-term)'); |
| 25 | is($data->[3]->[4], 'mate/d:NODE$<b>128<s>1', '< rel 2 (term-to-term)'); |
Akron | d99f8c8 | 2016-01-07 21:08:45 +0100 | [diff] [blame] | 26 | |
| 27 | done_testing; |
| 28 | |
| 29 | __END__ |
| 30 | |