tag fourth (and hopefully last) alpha
[bioperl-live.git] / branch-1-6 / t / SeqIO / lasergene.t
blobdd8cc889ab31df7a3a9b1d38675c381a2972ccd8
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN {
7         use lib '.';
8     use Bio::Root::Test;
9     
10     test_begin(-tests => 13);
11         
12         use_ok('Bio::SeqIO::lasergene');
15 my $verbose = test_debug();
18 # Positive tests
21 my $io = Bio::SeqIO->new(
22   -format => 'lasergene',
23   -verbose => $verbose,
24   -file => test_input_file('test.lasergene')
27 ok($io);
28 isa_ok($io, 'Bio::SeqIO');
30 my $seq;
32 ok($seq = $io->next_seq);
33 is($seq->length, 12*3);
34 is($seq->subseq(1,12), 'ATCGATCGATCG');
36 ok($seq = $io->next_seq);
37 is($seq->length, 200);
39 ok($seq = $io->next_seq);
40 is($seq->length, 70*5+12);
42 ok(not defined $io->next_seq);
45 # Negative tests
48 $io = Bio::SeqIO->new(
49   -format => 'lasergene',
50   -verbose => $verbose,
51   -file => test_input_file('test.fasta') # not lasergene!
54 ok($io);
56 eval { 
57   $io->next_seq;
59 like($@, qr/unexpected end of file/i);