~ubuntu-branches/ubuntu/oneiric/bioperl/oneiric

« back to all changes in this revision

Viewing changes to t/RelationshipType.t

  • Committer: Bazaar Package Importer
  • Author(s): Matt Hope
  • Date: 2004-04-18 14:24:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040418142411-gr92uexquw4w8liq
Tags: 1.4-1
* New upstream release
* Examples and working code are installed by default to usr/bin,
  this has been moved to usr/share/doc/bioperl/bin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-Perl-*-
 
2
## Bioperl Test Harness Script for Modules
 
3
## $Id: RelationshipType.t,v 1.3 2003/05/27 22:13:41 lapp Exp $
 
4
 
 
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'
 
7
 
 
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 => 21;
 
19
}
 
20
 
 
21
use Bio::Ontology::RelationshipType;
 
22
use Bio::Ontology::Ontology;
 
23
 
 
24
my $ont = Bio::Ontology::Ontology->new(-name => "relationship type");
 
25
  
 
26
my $IS_A     = Bio::Ontology::RelationshipType->get_instance("IS_A", $ont);
 
27
my $PART_OF  = Bio::Ontology::RelationshipType->get_instance("PART_OF", $ont);
 
28
my $CONTAINS = Bio::Ontology::RelationshipType->get_instance("CONTAINS", $ont);
 
29
my $FOUND_IN = Bio::Ontology::RelationshipType->get_instance("FOUND_IN", $ont);
 
30
my $IS_A2    = Bio::Ontology::RelationshipType->get_instance("IS_A", $ont);
 
31
 
 
32
ok( $IS_A->isa( "Bio::Ontology::RelationshipType" ) );
 
33
ok( $IS_A->isa( "Bio::Ontology::TermI" ) );
 
34
 
 
35
 
 
36
ok( ! $IS_A->equals( $PART_OF ) );
 
37
ok( $IS_A->equals( $IS_A2 ) );
 
38
ok( $PART_OF->equals( $PART_OF ) );
 
39
 
 
40
 
 
41
ok( $IS_A->identifier(), undef ); # don't make up identifiers
 
42
ok( $IS_A->name(), "IS_A" );
 
43
ok( $IS_A->definition(), "IS_A relationship predicate (type)" );
 
44
ok( $IS_A->ontology()->name(), "relationship type" );
 
45
 
 
46
 
 
47
ok( $PART_OF->identifier(), undef ); # don't make up identifiers
 
48
ok( $PART_OF->name(), "PART_OF" );
 
49
ok( $PART_OF->definition(), "PART_OF relationship predicate (type)" );
 
50
ok( $PART_OF->ontology()->name(), "relationship type" );
 
51
 
 
52
 
 
53
ok( $CONTAINS->identifier(), undef ); # don't make up identifiers
 
54
ok( $CONTAINS->name(), "CONTAINS" );
 
55
ok( $CONTAINS->definition(), "CONTAINS relationship predicate (type)" );
 
56
ok( $CONTAINS->ontology()->name(), "relationship type" );
 
57
 
 
58
 
 
59
ok( $FOUND_IN->identifier(), undef ); # don't make up identifiers
 
60
ok( $FOUND_IN->name(), "FOUND_IN" );
 
61
ok( $FOUND_IN->definition(), "FOUND_IN relationship predicate (type)" );
 
62
ok( $FOUND_IN->ontology()->name(), "relationship type" );
 
63
 
 
64
 
 
65
 
 
66
 
 
67
 
 
68