tests/testthat/test-cdb_flatten.R

test_that("cdb_flatten works correctly", {
  dbf1 <- cdb_flatten(Compadre)

  expect_s3_class(dbf1, "data.frame")
  expect_type(dbf1$matA, "character")
  expect_type(dbf1$matU, "character")
  expect_type(dbf1$matF, "character")
  expect_type(dbf1$matC, "character")
  expect_identical(dbf1$SpeciesAuthor, Compadre@data$SpeciesAuthor)
})


test_that("cdb_flatten warns and fails gracefully", {
  expect_error(cdb_flatten(Compadre@data))
})

Try the Rcompadre package in your browser

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

Rcompadre documentation built on Oct. 17, 2024, 1:07 a.m.