t/*: remove "use lib '.'" and t/lib/Error.pm
[bioperl-live.git] / t / SeqIO / tinyseq.t
blob2f6552d459a5da1876ec6d1210c5e3945dfc4166
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN {
7     use Bio::Root::Test;
9     test_begin(-tests => 16,
10                -requires_modules => [qw(XML::Parser::PerlSAX XML::Writer)]);
12     use_ok('Bio::SeqIO::tinyseq');
15 my $file    = test_input_file('test.tseq');
16 my $outfile = test_output_file();
18 my $instream = Bio::SeqIO->new( -file    => $file,
19                                 -format  => 'tinyseq' );
21 my $outstream = Bio::SeqIO->new( -file   => ">$outfile",
22                                  -format => 'tinyseq' );
24 my $seq = $instream->next_seq;
25 ok(defined $seq);
26 ok(defined $seq->seq);
27 is($seq->length, 5830);
28 is($seq->accession_number,'NM_002253');
29 ok($seq->species);
30 is($seq->species->binomial, 'Homo sapiens');
31 is($seq->species->ncbi_taxid, 9606);
32 $outstream->write_seq($seq);
33 undef $outstream;
35 ok(-s $outfile);
37 my $reread = Bio::SeqIO->new( -file   => $outfile,
38                               -format => 'tinyseq' );
40 my $seq2 = $reread->next_seq;
42 ok($seq2);
43 ok($seq2->seq);
44 is($seq2->length, 5830);
45 is($seq2->accession_number, 'NM_002253');
46 ok($seq2->species);
47 is($seq2->species->binomial, 'Homo sapiens');
48 is($seq2->species->ncbi_taxid, 9606);