1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 23,
11 -requires_module => 'Graph::Directed');
13 use_ok('Bio::Ontology::RelationshipType');
14 use_ok('Bio::Ontology::Ontology');
17 my $ont = Bio::Ontology::Ontology->new(-name => "relationship type");
19 my $IS_A = Bio::Ontology::RelationshipType->get_instance("IS_A", $ont);
20 my $PART_OF = Bio::Ontology::RelationshipType->get_instance("PART_OF", $ont);
21 my $CONTAINS = Bio::Ontology::RelationshipType->get_instance("CONTAINS", $ont);
22 my $FOUND_IN = Bio::Ontology::RelationshipType->get_instance("FOUND_IN", $ont);
23 my $IS_A2 = Bio::Ontology::RelationshipType->get_instance("IS_A", $ont);
25 isa_ok($IS_A, "Bio::Ontology::RelationshipType");
26 isa_ok($IS_A, "Bio::Ontology::TermI");
29 ok( ! $IS_A->equals( $PART_OF ) );
30 ok( $IS_A->equals( $IS_A2 ) );
31 ok( $PART_OF->equals( $PART_OF ) );
34 is( $IS_A->identifier(), undef ); # don't make up identifiers
35 is( $IS_A->name(), "IS_A" );
36 is( $IS_A->definition(), "IS_A relationship predicate (type)" );
37 is( $IS_A->ontology()->name(), "relationship type" );
40 is( $PART_OF->identifier(), undef ); # don't make up identifiers
41 is( $PART_OF->name(), "PART_OF" );
42 is( $PART_OF->definition(), "PART_OF relationship predicate (type)" );
43 is( $PART_OF->ontology()->name(), "relationship type" );
46 is( $CONTAINS->identifier(), undef ); # don't make up identifiers
47 is( $CONTAINS->name(), "CONTAINS" );
48 is( $CONTAINS->definition(), "CONTAINS relationship predicate (type)" );
49 is( $CONTAINS->ontology()->name(), "relationship type" );
52 is( $FOUND_IN->identifier(), undef ); # don't make up identifiers
53 is( $FOUND_IN->name(), "FOUND_IN" );
54 is( $FOUND_IN->definition(), "FOUND_IN relationship predicate (type)" );
55 is( $FOUND_IN->ontology()->name(), "relationship type" );