tag fourth (and hopefully last) alpha
[bioperl-live.git] / branch-1-6 / t / AlignIO / po.t
blob32e8adea551670219b957f450eee593120515008
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: po.t 14971 2008-10-28 16:08:52Z cjfields $
4 use strict;
6 BEGIN {
7         use lib '.';
8     use Bio::Root::Test;
9     
10     test_begin(-tests => 11);
11         
12         use_ok('Bio::AlignIO::po');
15 my $DEBUG = test_debug();
17 my ($str,$aln,$strout,$status);
19 # POA
20 # just skip on perl 5.6.0 and earlier as it causes a crash on 
21 # default perl with OS X 10.2
22 # fink perl 5.6.0 does not seem to have the problem
23 # can't figure out what it is so just skip for now
24 SKIP: {
25         skip("skipping due to bug in perl 5.6.0 that comes with OS X 10.2", 10) unless ($^O ne 'darwin' || $] > 5.006);
26         
27         $str = Bio::AlignIO->new(
28                           -file   => test_input_file('testaln.po'),
29                           -format => 'po',
30                           );
31         isa_ok($str, 'Bio::AlignIO');
32         $aln = $str->next_aln();
33         isa_ok($aln,'Bio::Align::AlignI');
34         is $aln->num_sequences, 6;
35         
36         # output is? i.e. does conversion from clustalw to po give the same alignment?
37         $str = Bio::AlignIO->new(
38                   '-file'   => test_input_file('testaln.aln'),
39                   '-format' => 'clustalw');
40         isa_ok($str,'Bio::AlignIO');
41         $aln = $str->next_aln();
42         isa_ok($aln,'Bio::Align::AlignI');
43         $strout = Bio::AlignIO->new(
44                  '-file'   => ">" . test_output_file(),
45                  '-format' => 'po');
46         $status = $strout->write_aln($aln);
47         is $status, 1, "po output test";
48         
49         $str = Bio::AlignIO->new(
50                  '-file'   => test_input_file('testaln.po'),
51                  '-format' => 'po');
52         isa_ok($str,'Bio::AlignIO');
53         my $aln2 = $str->next_aln();
54         isa_ok($aln2,'Bio::Align::AlignI');
55         is $aln2->num_sequences, $aln->num_sequences;
56         is $aln2->length, $aln->length;