Fix bug 253 testing for defined
[bioperl-live.git] / t / SeqIO / chaos.t
blobccc4e5c28fa68d4b3e39da8ea87439f89ab4c385
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN {
7     use lib '.';
8     use Bio::Root::Test;
10     test_begin(-tests               => 8,
11                -requires_module     => 'Data::Stag',
12                -requires_networking => 0);
14     use_ok('Bio::SeqIO::chaos');
17 my $verbose = test_debug();
19 TODO: {
20         my $format = 'chaos';
21         todo_skip "No tests for $format format -- no sample file to test against", 7, if 1;
23         my $seqio_obj = Bio::SeqIO->new(-file   => test_input_file("test.$format"),
24                                                                 -format => $format);
25         
26         isa_ok($seqio_obj, 'Bio::SeqIO');
27         
28         my @methods = qw(next_seq write_seq);
29         foreach my $method (@methods) {
30                 can_ok($seqio_obj, $method) || 
31                         diag "$method method not implemented for $format";      
32         }
33         
34         # checking the first sequence object
35         my $seq_obj = $seqio_obj->next_seq();
36         isa_ok($seq_obj, 'Bio::Seq');
37         my %expected = ('seq'         => '' .
38                                         'length'      => '',
39                                         'primary_id'  => '',
40                                         'description' => qr(),
41                                    );
42         is   ($seq_obj->seq(),         $expected{'seq'},         'sequence');
43         is   ($seq_obj->length(),      $expected{'length'},      'length');
44         is   ($seq_obj->primary_id(),  $expected{'primary_id'},  'primary_id');
45         like ($seq_obj->description(), $expected{'description'}, 'description');