tests/testthat/test-print.R

context('print test')

data("pbmc_small")

test_that("print", {
  text <- capture.output(print(pbmc_small))
  expect_equal(grep("Seurat-tibble abstraction", text), 1)
  i <- grep(str <- ".*Features=([0-9]+).*", text)
  expect_equal(gsub(str, "\\1", text[i]), paste(nrow(pbmc_small)))
  i <- grep(str <- ".*Cells=([0-9]+).*", text)
  expect_equal(gsub(str, "\\1", text[i]), paste(ncol(pbmc_small)))
})

test_that("glimpse", {
  text <- capture.output(glimpse(pbmc_small))
  expect_equal(length(text), 37)
})

Try the tidyseurat package in your browser

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

tidyseurat documentation built on May 29, 2024, 4:21 a.m.