tests/testthat/test-zcurve.R

context("zcurve tests")
set.seed(2019-01-15)
z   <- rnorm(2974) - 0.4
dat <- data.frame(zee = z)
zc  <- zcurve(dat, zee)

test_that("zcurve returns a ggplot2 object", {
  expect_is(zc, "ggplot")
})

test_that("zcurve data is equal to the number of observations", {
  expect_equal(nrow(zc$data), 2974)
})

test_that("zcurve will throw an error if the input is not numeric", {
  expect_error(zcurve(letters), "x must be a data frame")
})

Try the epikit package in your browser

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

epikit documentation built on Feb. 16, 2023, 7:42 p.m.