Added malt dependency resource
Change-Id: I9fdd2d4ff7c81631cb0b78cf29d45be2d6bd3335
diff --git a/t/annotation/malt_dependency.t b/t/annotation/malt_dependency.t
index 620b0ce..30ca0ea 100644
--- a/t/annotation/malt_dependency.t
+++ b/t/annotation/malt_dependency.t
@@ -2,28 +2,61 @@
use strict;
use warnings;
use utf8;
-use Test::More skip_all => 'Not yet implemented';
+use Log::Log4perl;
+
+Log::Log4perl->init({
+ 'log4perl.rootLogger' => 'DEBUG, STDERR',
+ 'log4perl.appender.STDERR' => 'Log::Log4perl::Appender::ScreenColoredLevels',
+ 'log4perl.appender.STDERR.layout' => 'PatternLayout',
+ 'log4perl.appender.STDERR.layout.ConversionPattern' => '[%r] %F %L %c - %m%n'
+});
+
+use Test::More;
use Scalar::Util qw/weaken/;
use Data::Dumper;
use lib 't/annotation';
use TestInit;
-ok(my $tokens = TestInit::tokens('0002'), 'Parse tokens');
-ok($tokens->add('Malt', 'dependency'), 'Add Structure');
+
+use_ok('KorAP::XML::Annotation::Malt::Dependency');
+
+ok(my $tokens = TestInit::tokens('0002', 'Tree_Tagger'), 'Parse tokens');
+
+ok($tokens->add('Malt', 'Dependency'), 'Add Dependency');
my $data = $tokens->to_data->{data};
-diag $data;
+is($data->{tokenSource}, 'tree_tagger#tokens', 'TokenSource');
+like($data->{foundries}, qr!malt/dependency!, 'foundries');
+like($data->{layerInfos}, qr!malt/d=rels!, 'foundries');
+
+my $stream = $data->{stream};
+
+is($stream->[0]->[0], '-:tokens$<i>31', 'Number of paragraphs');
+
+# Term2Term relation
+is($stream->[0]->[1], '<:malt/d:KON$<b>32<i>1', 'Term2Term relation');
+is($stream->[1]->[0], '>:malt/d:KON$<b>32<i>0', 'Term2Term relation');
+
+is($stream->[0]->[2], '<:malt/d:KON$<b>32<i>3', 'Term2Term relation');
+is($stream->[3]->[0], '>:malt/d:KON$<b>32<i>0', 'Term2Term relation');
+
+# Term2Element and Element2Term relation
+is($stream->[0]->[3], '<:malt/d:ROOT$<b>34<i>0<i>49<i>6<i>0', 'Term2Term relation');
+is($stream->[0]->[5], '>:malt/d:ROOT$<b>33<i>0<i>49<i>0<i>6', 'Term2Term relation');
+
+# Text element
+is($stream->[0]->[4], '<>:base/s:t$<b>64<i>0<i>238<i>30<b>0', 'Text element');
done_testing;
__END__
+diag $data;
-like($data->{foundries}, qr!xip/sentences!, 'data');
-is($data->{stream}->[0]->[1], '-:xip/sentences$<i>1', 'Number of paragraphs');
-is($data->{stream}->[0]->[0], '-:tokens$<i>18', 'Number of tokens');
+
+
is($data->{stream}->[0]->[2], '<>:xip/s:s$<b>64<i>0<i>129<i>17<b>0', 'Text');
is($data->{stream}->[0]->[3], '_0$<i>0<i>3', 'Position');
is($data->{stream}->[-1]->[0], '_17$<i>124<i>128', 'Position');