tests/testthat/test-rel_lynch.R

context("rel_lynch.R")

test_that("Inbreeding",{
  AA <- locus( c("A","A") )
  AB <- locus( c("A","B") )
  BB <- locus( c("B","B") )
  AC <- locus( c("A","C") )
  BC <- locus( c("B","C") )
  CC <- locus( c("C","C") )
  x <- c(AA,AA,AB,BB,CC,AB,AC,BB,BC,CC)
  
  expect_that( f <- rel_lynch( ), throws_error() )
  expect_that( f <- rel_lynch("B"), throws_error() )
  
  f <- rel_lynch( x )
  expect_true( is(f,"matrix"))
  expect_that( dim(f), is_equivalent_to( c(10,10)))
  expect_that( f[1,2], is_equivalent_to(1.0) ) 

  x[2] <- NA
  expect_message(f2<-rel_nason(x))
})
MarianaLag/Mlag documentation built on Feb. 13, 2020, 12:30 a.m.