File: Annotation.t

package info (click to toggle)
bioperl 1.0-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 10,784 kB
  • ctags: 4,962
  • sloc: perl: 70,732; xml: 3,279; lisp: 107; makefile: 53
file content (68 lines) | stat: -rw-r--r-- 1,549 bytes parent folder | download
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
60
61
62
63
64
65
66
67
68
# -*-Perl-*-
## Bioperl Test Harness Script for Modules
## $Id: Annotation.t,v 1.6 2001/01/25 22:13:40 jason 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 => 16;
}

use Bio::Annotation;
use Bio::Annotation::DBLink;

ok(1);

my $link1 = new Bio::Annotation::DBLink(-database => 'TSC',
				     -primary_id => 'TSC0000030'
				     );
ok defined $link1;
ok $link1->isa('Bio::Annotation::DBLink');

ok $link1->database(), 'TSC';

ok $link1->primary_id(), 'TSC0000030';

my $a = Bio::Annotation->new ( '-description'  => 'something');
ok defined $a;
ok $a->isa('Bio::Annotation');


$a->add_DBLink($link1);
ok defined $a;

foreach my $link ( $a->each_DBLink ) {
    $link->primary_id;
    $link->database;
}
ok ($a->each_DBLink, 1);


ok $a->description, 'something';


my $comment = Bio::Annotation::Comment->new( '-text' => 'sometext');

ok $comment->text, 'sometext';

my $ref = Bio::Annotation::Reference->new( '-authors' => 'author line',
					   '-title'   => 'title line',
					   '-location'=> 'location line',
					   '-start'   => 12);

ok $ref->authors, 'author line';
ok $ref->title,  'title line';
ok $ref->location, 'location line';
ok $ref->start, 12;

ok $ref->database, 'MEDLINE';