New INSTALL.WIN doc (from wiki)
[bioperl-live.git] / t / Measure.t
blob42e57adb2279fd444119b7857c7dd02046a49da1
1 # -*-Perl-*-
2 ## Bioperl Test Harness Script for Modules
3 ## $Id$
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'
8 use strict;
9 BEGIN {
10     # to handle systems with no installed Test module
11     # we include the t dir (where a copy of Test.pm is located)
12     # as a fallback
13     eval { require Test; };
14     if( $@ ) {
15         use lib 't';
16     }
17     use Test;
18     plan tests => 20;
21 use Bio::Phenotype::Measure;
22   
23 my $measure = Bio::Phenotype::Measure->new( -context     => "height",
24                                             -description => "desc",
25                                             -start       => 10,
26                                             -end         => 150,
27                                             -unit        => "cm",
28                                             -comment     => "comment" );
30 ok( $measure->isa( "Bio::Phenotype::Measure" ) );
32 ok( $measure->to_string() );
34 ok( $measure->context(), "height" );
35 ok( $measure->description(), "desc" );
36 ok( $measure->start(), 10 );
37 ok( $measure->end(), 150 );
38 ok( $measure->unit(), "cm" );
39 ok( $measure->comment(), "comment" );
41 $measure->init();
43 ok( $measure->context(), "" );
44 ok( $measure->description(), "" );
45 ok( $measure->start(), "" );
46 ok( $measure->end(), "" );
47 ok( $measure->unit(), "" );
48 ok( $measure->comment(), "" );
50 ok( $measure->context( "A" ), "A" );
51 ok( $measure->description( "B" ), "B" );
52 ok( $measure->start( "C" ), "C" );
53 ok( $measure->end( "D" ), "D" );
54 ok( $measure->unit( "E" ), "E" );
55 ok( $measure->comment( "F" ), "F" );