tests/testthat/test-get_operator_id_pre.R

context("get_operator_id_pre")

test_that("use", {

  testthat::expect_equal(
    get_operator_id_pre(
      tree_prior = create_bd_tree_prior()
    ),
    "BirthDeath"
  )

  testthat::expect_equal(
    get_operator_id_pre(
      tree_prior = create_yule_tree_prior()
    ),
    "YuleModel"
  )

  testthat::expect_equal(
    get_operator_id_pre(
      tree_prior = list(create_yule_tree_prior(id = "some_id"))
    ),
    "YuleModel"
  )

  testthat::expect_equal(
    get_operator_id_pre(
      tree_prior = create_ccp_tree_prior()
    ),
    "CoalescentConstant"
  )

  testthat::expect_error(
    get_operator_id_pre(
      tree_prior = "nonsense"
    )
  )

})
ropensci/beautier documentation built on April 2, 2024, 5:01 a.m.