tests/testthat/test-onexit.R

test_that("onexit usage works as expected", {
  skip_on_cran()

  slack_lm <- register_onexit(lm, "testing onexit")

  formula <- Sepal.Length ~ Sepal.Width
  mod <- slack_lm(formula, data = iris)

  expect_identical(
    mod$coefficients,
    lm(formula, data = iris)$coefficients
  )
})

Try the slackr package in your browser

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

slackr documentation built on March 7, 2023, 8 p.m.