~ubuntu-branches/ubuntu/trusty/bioperl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/bsml_sax.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*-Perl-*-
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 $
4
 
#
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'
7
 
 
8
 
use strict;
9
 
use vars qw($error $NUMTESTS);
10
 
BEGIN {
11
 
        $NUMTESTS = 16;
12
 
        $error = 0;
13
 
    # to handle systems with no installed Test module
14
 
    # we include the t dir (where a copy of Test.pm is located)
15
 
    # as a fallback
16
 
    eval { require Test::More; };
17
 
    if ( $@ ) {
18
 
                use lib 't\lib';
19
 
    }
20
 
    use Test::More;
21
 
        
22
 
        eval {
23
 
                require XML::SAX;
24
 
                require XML::SAX::Writer;
25
 
                require XML::SAX::Base;
26
 
        };
27
 
        if ($@) {
28
 
                plan skip_all => 'XML::SAX::Base or XML::SAX or XML::SAX::Writer not found - skipping bsml_sax tests';
29
 
        }
30
 
        else {
31
 
                plan tests => $NUMTESTS;
32
 
        }
33
 
}
34
 
 
35
 
use_ok('Bio::SeqIO');
36
 
use_ok('Bio::Root::IO');
37
 
 
38
 
my $verbose = $ENV{'BIOPERLDEBUG'};
39
 
 
40
 
my $str = Bio::SeqIO->new(-format => 'bsml_sax',
41
 
                          -verbose => $verbose,
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');
47
 
is(@refs, 2);
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;
55
 
is(@feats, 2);
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);