Added struct support and PTI
Change-Id: Ia418958e1c26f2c83026c29089be806cad157762
diff --git a/t/tokens.t b/t/tokens.t
new file mode 100644
index 0000000..a640754
--- /dev/null
+++ b/t/tokens.t
@@ -0,0 +1,68 @@
+#!/usr/bin/env perl
+# source ~/perl5/perlbrew/etc/bashrc
+# perlbrew switch perl-blead@korap
+use strict;
+use warnings;
+use utf8;
+use Test::More;
+use Benchmark ':hireswallclock';
+use lib 'lib', '../lib';
+
+use_ok('KorAP::Field::MultiTerm');
+
+ok(my $term = KorAP::Field::MultiTerm->new(
+ term => 'Baum',
+ p_start => 0,
+ p_end => 56,
+ payload => '<i>56',
+ o_start => 34,
+ o_end => 120
+), 'Create new object');
+
+is($term->term, 'Baum');
+is($term->p_start, 0);
+is($term->p_end, 56);
+is($term->o_start, 34);
+is($term->o_end, 120);
+is($term->payload, '<i>56');
+is($term->to_string, 'Baum#34-120$<i>56<i>56');
+
+ok($term = KorAP::Field::MultiTerm->new(
+ term => 'Baum'
+), 'Create new object');
+
+is($term->term, 'Baum');
+is($term->p_start, 0);
+is($term->p_end, 0);
+is($term->o_start, 0);
+is($term->o_end, 0);
+is($term->payload, undef);
+is($term->to_string, 'Baum');
+
+ok($term = KorAP::Field::MultiTerm->new(
+ term => 'Ba#um'
+), 'Create new object');
+
+is($term->term, 'Ba#um');
+is($term->p_start, 0);
+is($term->p_end, 0);
+is($term->o_start, 0);
+is($term->o_end, 0);
+is($term->payload, undef);
+is($term->to_string, 'Ba\#um');
+
+ok($term = KorAP::Field::MultiTerm->new(
+ term => 'Ba#u$m',
+ payload => '<i>45'
+), 'Create new object');
+
+is($term->term, 'Ba#u$m');
+is($term->p_start, 0);
+is($term->p_end, 0);
+is($term->o_start, 0);
+is($term->o_end, 0);
+is($term->payload, '<i>45');
+is($term->to_string, 'Ba\#u\$m$<i>45');
+
+done_testing;
+__END__