tests/testthat/test_get_evo_settings.R

library(martini)

set.seed(0)

test_that("default args are being set", {
  expect_equal(get_evo_settings()$modelScore, 1)
  expect_equal(get_evo_settings()$associationScore, 1)
  expect_equal(get_evo_settings()$etas, numeric())
  expect_equal(get_evo_settings()$lambdas, numeric())
  expect_equal(get_evo_settings()$debug, FALSE)
})

test_that("default we can change values", {
  expect_equal(get_evo_settings(modelScore = "consistency")$modelScore, 0)
  expect_equal(get_evo_settings(modelScore = "bic")$modelScore, 1)
  expect_equal(get_evo_settings(modelScore = "aic")$modelScore, 2)
  expect_equal(get_evo_settings(modelScore = "aicc")$modelScore, 3)
  expect_equal(get_evo_settings(modelScore = "mbic")$modelScore, 4)
  expect_error(get_evo_settings(modelScore = "kk"))
  expect_equal(get_evo_settings(associationScore = "skat")$associationScore, 0)
  expect_equal(get_evo_settings(associationScore = "chi2")$associationScore, 1)
  expect_error(get_evo_settings(associationScore = "kk"))
  expect_equal(get_evo_settings(etas = c(3,4,5))$etas, c(3,4,5))
  expect_error(get_evo_settings(etas = c("a","b"))$etas)
  expect_equal(get_evo_settings(lambdas = c(3,4,5))$lambdas, c(3,4,5))
  expect_error(get_evo_settings(lambdas = c("a","b"))$lambdas)
  expect_equal(get_evo_settings(debug = FALSE)$debug, FALSE)
  expect_equal(get_evo_settings(debug = TRUE)$debug, TRUE)
  expect_error(get_evo_settings(debug = 3))
})

Try the martini package in your browser

Any scripts or data that you put into this service are public.

martini documentation built on Nov. 8, 2020, 5:39 p.m.