1 ## Bioperl Test Harness Script for Modules
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 # Test script for Bio::Tools::Fasta.pm
9 # Steve A. Chervitz, sac@neomorphic.com
11 # Strategy for this test was borrowed from L. Stein's BoulderIO package.
13 ## perl test harness expects the following output syntax only!
15 ## ok 1 [not ok 1 (if test fails)]
17 ## ok 2 [not ok 2 (if test fails)]
19 ## ok 3 [not ok 3 (if test fails)]
21 ## etc. etc. etc. (continue on for each tested function in the .t file)
22 #-----------------------------------------------------------------------
24 ## We start with some black magic to print on failure.
25 BEGIN { $| = 1; print "1..5\n"; }
26 END {print "not ok 1\n" unless $loaded;}
29 use Bio::Tools::Fasta;
32 print "ok 1\n"; # 1st test passes.
35 my($num, $true,$msg) = @_;
36 print($true ? "ok $num\n" : "not ok $num $msg\n");
41 test 2, $fasta = new Bio::Tools::Fasta (-file => 't/seqs.fas',
43 -save_array => \@seqs,
48 test 3, scalar(@seqs) == 6, "Number of seqs = ${\scalar(@seqs)}";
50 test 4, $fasta->num_seqs == 6, "Number of seqs = ${\$fasta->num_seqs}";
52 print "First sequence:\n";
54 test 5, print $seqs[0]->layout('fasta');