Permalink
Browse files

sort the returned values for test purposes; order of terms may not be…

… important
  • Loading branch information...
1 parent da78229 commit 4ad78e54fdb61f647221ade9f1cf91a06e654573 Chris Fields committed Aug 10, 2013
Showing with 7 additions and 7 deletions.
  1. +7 −7 t/Ontology/IO/obo.t
View
@@ -30,7 +30,7 @@ is (scalar(@roots), 1);
is ($roots[0]->name(), "Sequence_Ontology");
is ($roots[0]->identifier(), "SO:0000000");
-my @terms = $ont->get_child_terms($roots[0]);
+my @terms = sort {$a->name cmp $b->name} $ont->get_child_terms($roots[0]);
is (scalar(@terms), 5);
my ($term) = grep { $_->name() eq "variation_operation"; } @terms;
ok $term;
@@ -43,7 +43,7 @@ ok $term;
($term) = grep { $_->name() eq "located_sequence_feature"; } @terms;
ok $term;
-@terms = $ont->get_child_terms($terms[0]);
+@terms = sort {$a->name cmp $b->name} $ont->get_child_terms($terms[4]);
is (scalar(@terms), 5);
($term) = grep { $_->name() eq "translocate"; } @terms;
ok $term;
@@ -57,7 +57,7 @@ ok $term;
ok $term;
my $featterm = $terms[0];
-@terms = $ont->get_child_terms($featterm);
+@terms = sort {$a->name cmp $b->name} $ont->get_child_terms($featterm);
is (scalar(@terms), 2);
# substitution has two parents, see whether this is handled
@@ -174,12 +174,12 @@ is($bioont->get_relationship_type('POSITIVELY_REGULATES')->name,'POSITIVELY_REGU
## -- getting relationships for various ontologies
-my @onto_pred = $ontologies[0]->get_predicate_terms();
-my @bio_pred = $bioont->get_predicate_terms();
+my @onto_pred = sort {$a->name cmp $b->name} $ontologies[0]->get_predicate_terms();
+my @bio_pred = sort {$a->name cmp $b->name} $bioont->get_predicate_terms();
is(scalar @onto_pred,6,'Got predicates for gene_ontology');
is(scalar @bio_pred,2,'Got predicates for biological_process');
-is($onto_pred[3]->name(),'REGULATES','Got regulates predicate');
-is($bio_pred[1]->name(),'POSITIVELY_REGULATES','Got positively regulates predicate');
+is($onto_pred[4]->name(),'REGULATES','Got regulates predicate');
+is($bio_pred[0]->name(),'POSITIVELY_REGULATES','Got positively regulates predicate');
my @bio_rel = $bioont->get_relationships();

0 comments on commit 4ad78e5

Please sign in to comment.