1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
# -*-Perl-*-
## Bioperl Test Harness Script for Modules
## $Id: MapIO.t,v 1.3 2002/02/11 09:31:34 heikki Exp $
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.t'
my $error = 0;
use strict;
BEGIN {
# to handle systems with no installed Test module
# we include the t dir (where a copy of Test.pm is located)
# as a fallback
eval { require Test; };
if( $@ ) {
use lib 't';
}
use Test;
plan tests => 23;
}
if( $error == 1 ) {
exit(0);
}
use vars qw($FILE1 $FILE2);
$FILE1= 'testmap.map';
END { unlink $FILE1; }
use Bio::MapIO;
use Bio::Root::IO;
my $verbose = $ENV{'BIOPERLDEBUG'};
ok 1;
ok my $mapio = new Bio::MapIO('-verbose' => $verbose,
'-format' => 'mapmaker',
'-file' => Bio::Root::IO->catfile('t','data',
'mapmaker.out'));
my $map = $mapio->next_map;
ok(ref($map) && $map->isa('Bio::Map::MapI'));
ok $map->units, 'cM';
ok $map->type, 'Genetic';
ok $map->name('test map'), 'test map'; # map name is unset for this data type
my $count = 1;
foreach my $marker ( $map->each_element ) {
ok($marker->position->order,$count++);
}
|