A test to ensure Bio::PrimarySeqI->trunc() doesn't use clone() for a Bio::Seq::RichSe...
[bioperl-live.git] / t / Seq / DBLink.t
blobda3c6ba06e84d0923ea07edc9655fd350a68891f
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 => 131);
11         
12     use_ok('Bio::SeqIO');
15 my @genbank_files = qw/BK000016-tpa.gbk ay116458.gb ay149291.gb NC_006346.gb ay007676.gb dq519393.gb P35527.gb/;
17 # bug 2152
18 #------------------------------------
19 my $verbose = test_debug();
20 for my $in ( @genbank_files ) {
21     my $infile = test_input_file($in);
22     my $seqio = Bio::SeqIO->new(
23                             -format  =>'genbank',
24                             -verbose => $verbose,
25                             -file    => $infile,
26     );
27     my $seq = $seqio->next_seq;
28     my @values = $seq->annotation->get_Annotations('dblink');
29     foreach my $value (@values) {
30         my $output = $value->display_text;
31         ok(defined $output, '"'.$output . '"');          # check value is not empty
32         ok(index($output,'::') < 0       , 'no double colon'  );  # these tests seems silly
33         ok( substr($output,-1) ne ':'    , 'no trailing colon');  #    but all have been known to occur
34         ok(index($output,'  ') < 0       , 'no double space'  );  #
35         my @parts = split(/:/,$output, 2);
36         ok( scalar(@parts) == 2, 'dblink value is splittable');
37     }
39 #------------------------------------