tests/testthat/test_expnumstat.R

context("Summary statistics for numerical variables")

test_that("test normal function", {
  expect_error(ExpNumStat(mtcars, by = "ABC", gp = "gear",
                          Qnt = c(0.1, 0.2), MesofShape = 2))
  expect_error(ExpNumStat(mtcars, by = "G", gp = NULL,
                          Qnt = c(0.1, 0.2), MesofShape = 2))
  expect_error(ExpNumStat(iris$Species))
})

test_that("test output object", {
  numstat <- ExpNumStat(mtcars, by = "A")
  expect_output(str(numstat), "data.frame")
})

Try the SmartEDA package in your browser

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

SmartEDA documentation built on Dec. 4, 2022, 1:15 a.m.