Couple more minor edits ...
[bioperl-live.git] / t / SeqFeature / FeaturePair.t
blob9982e2730b392716a49e65c87ed7ede88aee0b61
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN { 
7     use lib '.';
8     use Bio::Root::Test;
9     
10     test_begin(-tests => 19);
12     use_ok('Bio::SeqFeature::Generic');
13     use_ok('Bio::SeqFeature::FeaturePair');
17 my ($feat, $feat2, $pair);
19 ok $pair = Bio::SeqFeature::FeaturePair->new();
21 ok $feat = Bio::SeqFeature::Generic->new(
22     -start => 40,
23     -end => 80,
24     -strand => 1,
25     -primary => 'exon',
26     -source => 'internal',
27     -display_name => 'my exon feature',
28     -tag => {
29         silly => 20,
30         new => 1
31     }
34 ok $feat2 = Bio::SeqFeature::Generic->new(
35     -start => 400,
36     -end => 440,
37     -strand => 1,
38     -primary => 'other',
39     -source => 'program_a',
40     -phase => 1,
41     -tag => {
42         silly => 20,
43         new => 1
44     }
47 ok $pair->feature1($feat);
48 ok $pair->feature2($feat2);
50 is $pair->feature1, $feat, 'feature1 of pair stored';
51 is $pair->feature2, $feat2, 'feature2 of pair stored';
52 is $pair->start, 40, 'feature start';
53 is $pair->end, 80, 'feature end';
54 is $pair->primary_tag, 'exon', 'primary tag';
55 is $pair->source_tag, 'internal', 'source tag';
56 is $pair->hstart, 400, 'hstart';
57 is $pair->hend, 440, 'hend';
58 is $pair->hprimary_tag, 'other', 'hprimary tag';
59 is $pair->hsource_tag, 'program_a', 'hsource tag';
61 ok $pair->invert;
62 is $pair->end, 440, 'inverted end';