added bio::ext support
[bioperl-live.git] / t / SimpleAlign.t
blobb41fc62fe8230ab30c825026e8f515c80cee9ae7
1 ## Bioperl Test Harness Script for Modules
2 ## $Id$
4 # Before `make install' is performed this script should be runnable with
5 # `make test'. After `make install' it should work as `perl test.t'
7 #-----------------------------------------------------------------------
8 ## perl test harness expects the following output syntax only!
9 ## 1..3
10 ## ok 1  [not ok 1 (if test fails)]
11 ## 2..3
12 ## ok 2  [not ok 2 (if test fails)]
13 ## 3..3
14 ## ok 3  [not ok 3 (if test fails)]
16 ## etc. etc. etc. (continue on for each tested function in the .t file)
17 #-----------------------------------------------------------------------
20 ## We start with some black magic to print on failure.
21 BEGIN { $| = 1; print "1..6\n"; }
22 END {print "not ok 1\n" unless $loaded;}
24 use lib '../';
25 use Bio::SimpleAlign;
27 $loaded = 1;
28 print "ok 1\n";    # 1st test passes.
31 ## End of black magic.
33 ## Insert additional test code below but remember to change
34 ## the print "1..x\n" in the BEGIN block to reflect the
35 ## total number of tests that will be run. 
37 open(FH,"t/test.mase") || die "Could not open test.mase $!";
38 $aln = Bio::SimpleAlign->new();
39 $aln->read_mase(\*FH);
40 close(FH);
42 if( $aln ) {
43         print "ok 2\n";
44 } else {
45         print "not ok 2\n";
46 }       
48 open(OUT,">t/out.aln_fasta"); 
49 $aln->write_fasta(\*OUT);
50 close(OUT);
51 print "ok 3\n";
54 $aln = Bio::SimpleAlign->new();
55 open(FH,"t/test.pfam");
56 $aln->read_Pfam(\*FH);
57 close(FH);
59 if( $aln ) {
60         print "ok 4\n";
61 } else {
62         print "not ok 4\n";
63 }       
65 open(OUT,">t/out.pfam"); 
66 $aln->write_Pfam(\*OUT);
67 close(OUT);
68 print "ok 5\n";
71 $aln = Bio::SimpleAlign->new();
72 open(IN,"t/out.pfam");
73 $aln->read_Pfam(\*IN);
74 close(IN);
76 if( $aln ) {
77         print "ok 6\n";
78 } else {
79         print "not ok 6\n";
80 }