1 # -*-Perl-*- Test Harness script for Bioperl
11 test_begin(-tests => 14);
13 use_ok('Bio::Tools::Primer3');
16 my ($p3, $num, $primer);
18 ok $p3 = Bio::Tools::Primer3->new(-file => test_input_file('primer3_output.txt'));
19 ok $num = $p3->number_of_results;
20 is $num, 5 or diag "Got $num";
21 ok $num = $p3->all_results;
22 is defined $num, 1 or diag "Can't get all results";
23 ok $num = $p3->primer_results(1);
24 is defined $num, 1 or diag "Can't get results for 1";
25 ok $primer = $p3->next_primer;
26 isa_ok $primer, "Bio::Seq::PrimedSeq" or diag
27 "reference for primer stream is not right";
30 my $left_primer = $primer->get_primer('left');
32 # get the sequence for that primer. This is a test to verify behavior
33 # on the bioperl list in or about 050315
34 my $seqobj = $left_primer->seq();
36 my $seq = $seqobj->seq();
38 my $other_left_primer = $primer->get_primer();
40 # a different way to access the primers in the stream
41 my $alt = $p3->primer_results(0,'PRIMER_LEFT_INPUT');
44 ok $primer = $p3->next_primer;
46 my $left_primer_seq = $primer->get_primer('left')->seq;
47 is $left_primer_seq->seq, "GAGGGTAACACGCTGGTCAT";
50 ok $p3 = Bio::Tools::Primer3->new(-file => test_input_file('bug2862.pmr'));
52 while ($p3->next_primer) { $num++ };
53 is $p3->number_of_results, $num, 'bug 2862';