2 ## Bioperl Test Harness Script for Modules
5 # Before `make install' is performed this script should be runnable with
6 # `make test'. After `make install' it should work as `perl test.t'
10 # to handle systems with no installed Test module
11 # we include the t dir (where a copy of Test.pm is located)
13 eval { require Test; };
25 my $range = Bio::Range->new(-start=>10,
29 ok( $range->strand, 1);
31 my $range2 = Bio::Range->new(-start=>15,
36 ok($range2->strand, 1);
38 my $r = Bio::Range->new();
40 ok($r->start(27), 27);
43 ok(! defined $r->intersection($range2));
45 $r = $range->union($range2);
49 $r = $range->intersection($range2);
53 ok !($range->contains($range2));
54 ok !($range2->contains($range));
55 ok ($range->overlaps($range2));
56 ok ($range2->overlaps($range));
63 my $range3 = Bio::Range->new(-start=>15,
67 my $range4 = Bio::Range->new(-start=>15,
71 my $range5 = Bio::Range->new(-start=>15,
75 ok $range3->_ignore($range4); # 1 & -1
76 ok $range3->_weak($range3); # 1 & 1 true
77 ok $range3->_weak($range5); # 1 & 0 true
78 ok ! ($range3->_weak($range4)); # 1 & -1 false
79 ok $range3->_strong($range3); # 1 & 1 true
80 ok ! ($range3->_strong($range5)); # 1 & 0 false
81 ok ! ($range3->_strong($range4)); # 1 & -1 false
84 ok ! ( $range3->overlaps($range4,'weak'));
85 ok ! ( $range4->overlaps($range3,'weak'));
86 ok ! ( $range3->overlaps($range4,'strong'));
87 ok ! ( $range4->overlaps($range3,'strong'));
90 ok ( $range3->overlaps($range4,'weak'));
91 ok ( $range4->overlaps($range3,'weak'));
92 ok ! ( $range3->overlaps($range4,'strong'));
93 ok ! ( $range4->overlaps($range3,'strong'));