File: Measure.t

package info (click to toggle)
bioperl 1.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 20,336 kB
  • ctags: 8,476
  • sloc: perl: 119,890; xml: 6,001; lisp: 121; makefile: 57
file content (59 lines) | stat: -rw-r--r-- 1,668 bytes parent folder | download | duplicates (2)
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
56
57
58
59
# -*-Perl-*-
## Bioperl Test Harness Script for Modules
## $Id: Measure.t,v 1.1 2002/09/10 06:50:18 czmasek Exp $

# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.t'

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 => 20;
}

use Bio::Phenotype::Measure;
  
my $measure = Bio::Phenotype::Measure->new( -context     => "height",
                                            -description => "desc",
                                            -start       => 10,
                                            -end         => 150,
                                            -unit        => "cm",
                                            -comment     => "comment" );

ok( $measure->isa( "Bio::Phenotype::Measure" ) );

ok( $measure->to_string() );

ok( $measure->context(), "height" );
ok( $measure->description(), "desc" );
ok( $measure->start(), 10 );
ok( $measure->end(), 150 );
ok( $measure->unit(), "cm" );
ok( $measure->comment(), "comment" );

$measure->init();

ok( $measure->context(), "" );
ok( $measure->description(), "" );
ok( $measure->start(), "" );
ok( $measure->end(), "" );
ok( $measure->unit(), "" );
ok( $measure->comment(), "" );

ok( $measure->context( "A" ), "A" );
ok( $measure->description( "B" ), "B" );
ok( $measure->start( "C" ), "C" );
ok( $measure->end( "D" ), "D" );
ok( $measure->unit( "E" ), "E" );
ok( $measure->comment( "F" ), "F" );