2
## Bioperl Test Harness Script for Modules
3
## $Id: RelationshipType.t,v 1.3 2003/05/27 22:13:41 lapp Exp $
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'
10
# to handle systems with no installed Test module
11
# we include the t dir (where a copy of Test.pm is located)
13
eval { require Test; };
21
use Bio::Ontology::RelationshipType;
22
use Bio::Ontology::Ontology;
24
my $ont = Bio::Ontology::Ontology->new(-name => "relationship type");
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);
32
ok( $IS_A->isa( "Bio::Ontology::RelationshipType" ) );
33
ok( $IS_A->isa( "Bio::Ontology::TermI" ) );
36
ok( ! $IS_A->equals( $PART_OF ) );
37
ok( $IS_A->equals( $IS_A2 ) );
38
ok( $PART_OF->equals( $PART_OF ) );
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" );
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" );
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" );
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" );