2
# Bioperl Test Harness Script for Modules
3
# $Id: bsml_sax.t,v 1.2.6.1 2006/11/30 09:24:00 sendu 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'
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::More; };
24
require XML::SAX::Writer;
25
require XML::SAX::Base;
28
plan skip_all => 'XML::SAX::Base or XML::SAX or XML::SAX::Writer not found - skipping bsml_sax tests';
31
plan tests => $NUMTESTS;
36
use_ok('Bio::Root::IO');
38
my $verbose = $ENV{'BIOPERLDEBUG'};
40
my $str = Bio::SeqIO->new(-format => 'bsml_sax',
42
-file => Bio::Root::IO->catfile
43
(qw(t data U83300.bsml) ));
44
my $seq = $str->next_seq;
45
isa_ok($seq, 'Bio::Seq::RichSeqI');
46
my @refs = $seq->annotation->get_Annotations('reference');
48
is($seq->display_id,'MIVN83300');
49
is($seq->molecule ,'dna');
50
ok(! $seq->is_circular);
51
is($seq->get_dates,2);
52
is($seq->accession_number, 'U83300');
53
is($seq->seq_version,1);
54
my @feats = $seq->get_SeqFeatures;
56
is($feats[1]->start, 1);
57
is($feats[1]->end, 946);
58
is($feats[1]->get_tag_values('db_xref'), 3);
59
is($seq->annotation->get_Annotations('reference'),2);
60
is($seq->annotation->get_Annotations('dblink'),2);