Skip to content

Commit

Permalink
increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobbossek committed Aug 10, 2015
1 parent c1c798c commit 2c8d210
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/testthat/test_recombinators.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ test_that("recombinators for permutations work as expected", {
expected = seq(n) # sequence we expect offspring to be a permutation of

# check validity of produced output for each permutation-based recombinator
for (recombinatorGenerator in c(makePMXRecombinator)) {
available.recombinators = c(makePMXRecombinator, makePMXRecombinator)
for (recombinatorGenerator in available.recombinators) {
recombine = recombinatorGenerator()
# generate sample permutations
parent1 = sample(n)
Expand Down
6 changes: 5 additions & 1 deletion tests/testthat/test_selectors.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ test_that("parent selectors work as expected", {

n.mating.pool = 5L

for (selectorGenerator in c(makeRouletteWheelSelector, makeTournamentSelector)) {
avialable.selectors = c(makeGreedySelector,
makeRouletteWheelSelector, makeTournamentSelector
)

for (selectorGenerator in avialable.selectors) {
select = selectorGenerator()
mating.pool = select(population, list(), n.mating.pool)
expect_is(mating.pool, "ecrPopulation")
Expand Down

0 comments on commit 2c8d210

Please sign in to comment.