1 # -*-Perl-*- Test Harness script for Bioperl
4 # This will outline tests for the population genetics simulation
5 # in the Bio::PopGen::Simulation namespace
6 # Coalescent has its own tests though in t/Coalescent.t
14 test_begin(-tests => 23);
16 use_ok 'Bio::PopGen::Simulation::GeneticDrift';
19 my $sim = Bio::PopGen::Simulation::GeneticDrift->new(-popsize => 40,
20 -alleles => {A => 0.2,
25 my %f = $sim->next_generation;
26 push @Afreqs, $f{'A'};
27 push @Bfreqs, $f{'B'};
28 is(($f{'A'}||0) + ($f{'B'}||0), 1, 'Allele freqs should sum to 1');
32 cmp_ok (($Afreqs[9]||0), '<=', 1, 'All frequencies should be <= 1');
34 $sim = Bio::PopGen::Simulation::GeneticDrift->new(-popsize => 50,
35 -alleles => {A => 0.2,
41 my %f = $sim->next_generation;
42 is(($f{'A'}||0) + ($f{'B'}||0) + ($f{'C'}||0), 1, 'Allele freqs should sum to 1');