tests/testthat/test-to_genepop.R

context("to_genepop.R")

test_that("text output", {
  A <- locus( c("1","1"))
  B <- locus( c("1","2"))
  C <- locus( c("2","2"))
  loc1 <- c( A, A, B, B, B, B, C, C)
  loc2 <- c( A, B, B, C, A, B, A, C)

  pop <- data.frame( Population=c( rep("A",4),rep("B",4) ), loc1, loc2)
  
  expect_that( to_genepop(), throws_error() )
  
  gp <- to_genepop(pop, stratum="Population")
  expect_that( gp, is_a("character"))
  expect_that( nchar(gp), equals(135) )
  
})
MarianaLag/Mlag documentation built on Feb. 13, 2020, 12:30 a.m.