tests/testthat/test_import_convertLabel.R

###### test import from eatTools convertLabel
# convertLabel_df <- readRDS(file = "tests/testthat/helper_convertLabel.RDS")
convertLabel_df <- readRDS(file = "helper_convertLabel.RDS")

test_that("Data frames from eatTools convertLabel imported correctly", {
  out <- import_convertLabel(convertLabel_df)
  expect_equal(extractMeta(out, "year")[["varLabel"]], "year of assessment")
  expect_equal(extractMeta(out, "mig")[["varLabel"]], NA_character_)
  expect_equal(extractMeta(out, "sex")[["valLabel"]], c("female", "male"))

  expect_equal(dim(out$dat), c(5, 22))
})

Try the eatGADS package in your browser

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

eatGADS documentation built on Oct. 9, 2024, 5:09 p.m.