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
|
#!/usr/local/bin/perl -w
use lib '.';
use constant NUMTESTS => 3;
BEGIN {
eval { require Test; };
use Test;
plan tests => NUMTESTS;
}
# All tests must be run from the software directory;
# make sure we are getting the modules from here:
use strict;
use GO::Parser;
# ----- REQUIREMENTS -----
# goflat format files using !type: headers should be parsed
# types may be odd characters
# ------------------------
if (1) {
my $f = './t/data/test2.ontology';
my $parser = new GO::Parser;
$parser->parse($f);
my $obo = $parser->handler->stag;
my @typedefs = $obo->get_typedef;
my %th = map {$_->sget_id => 1} @typedefs;
ok(scalar (@typedefs),5);
my @terms = $obo->get_term;
ok(scalar (@terms),7);
print $_->sxpr foreach @terms;
my @rels = $obo->find_relationship;
my @bad = grep {!$th{$_->sget_type}} @rels;
ok(!@bad);
}
|