inst/tests/test_well-map.R

library(testthat)
context("Testing the well-mapping content of the OPM package for consistency")


if (!exists("TEST.DIR"))
  attach(objects_for_testing())


################################################################################


## WELL_MAP
test_that("substrate names are ok", {
  expect_false(any(grepl("\\sacid$", WELL_MAP, FALSE, TRUE)))
  expect_false(any(grepl(" - ", WELL_MAP, FALSE, TRUE)))
  expect_false(any(grepl("[^',()A-Za-z0-9 #%./+-]", WELL_MAP, FALSE, TRUE)))
  expect_false(is.unsorted(rownames(WELL_MAP))) # wells should be sorted
  expect_false(is.unsorted(colnames(WELL_MAP))) # plates should be sorted
})


## WELL_MAP
test_that("substrate IDs in well map can query substrate information", {
  all.ids <- seq.int(nrow(SUBSTRATE_INFO))
  expect_true(setequal(WELL_MAP[, , "substrate_id"], all.ids))
})

Try the opm package in your browser

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

opm documentation built on May 2, 2019, 6:08 p.m.