2 # Bioperl Test Harness Script for Modules
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'
9 use vars qw($error $NUMTESTS);
13 # to handle systems with no installed Test module
14 # we include the t dir (where a copy of Test.pm is located)
16 eval { require Test; };
20 # bsml_sax uses XML::SAX
21 eval {require XML::SAX;
22 require XML::SAX::Writer;
23 require XML::SAX::Base;
28 warn "XML::SAX::Base or XML::SAX or XML::SAX::Writer not found - skipping bsml_sax tests\n";
31 plan tests => $NUMTESTS;
35 foreach ( $Test::ntest..$NUMTESTS) {
36 skip('Unable to run BSML_sax tests because XML::SAX is not installed',1);
49 my $verbose = $ENV{'BIOPERLDEBUG'};
52 my $str = Bio::SeqIO->new(-format => 'bsml_sax',
54 -file => Bio::Root::IO->catfile
55 (qw(t data U83300.bsml) ));
56 ok(my $seq = $str->next_seq);
57 my @refs = $seq->annotation->get_Annotations('reference');
59 ok($seq->display_id,'MIVN83300');
60 ok($seq->molecule ,'dna');
61 ok(! $seq->is_circular);
62 ok($seq->get_dates,2);
63 ok($seq->accession_number, 'U83300');
64 ok($seq->seq_version,1);
65 my @feats = $seq->get_SeqFeatures;
67 ok($feats[1]->start, 1);
68 ok($feats[1]->end, 946);
69 ok($feats[1]->get_tag_values('db_xref'), 3);
70 ok($seq->annotation->get_Annotations('reference'),2);
71 ok($seq->annotation->get_Annotations('dblink'),2);