tests/testthat/test-tabulate-biomass.R

test_that("ypr_tabulate_biomass", {
  biomass <- ypr_tabulate_biomass(ypr_population())

  expect_error(chk::check_data(
    biomass,
    values = list(
      Age = c(1L, 100L),
      Length = c(0, .Machine$double.xmax),
      Weight = c(0, .Machine$double.xmax),
      Fecundity = c(0, .Machine$double.xmax),
      Survivors = c(0, 1),
      Spawners = c(0, .Machine$double.xmax),
      Biomass = c(0, .Machine$double.xmax),
      Eggs = c(0, .Machine$double.xmax)
    ),
    nrow = TRUE,
    exclusive = TRUE,
    order = TRUE
  ), NA)
})

Try the ypr package in your browser

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

ypr documentation built on Aug. 30, 2022, 1:11 a.m.