tests/testthat/test-counts.R

f <- system.file("extdata", "example1sec.csv", package = "AGread")

testthat::test_that("csv file reading produces expected output", {

  save_counts <- function(code) {
    path <- tempfile(fileext = ".rds")
    saveRDS(code, path)
    path
  }

  testthat::expect_snapshot_file(
    save_counts(
      read_AG_counts(f, header = TRUE)
    ),
    "read_counts.rds"
  )

})

Try the AGread package in your browser

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

AGread documentation built on Sept. 13, 2022, 5:06 p.m.