tests/testthat/test-base-override.R

testthat::test_that("problematic base function calls throw warnings", {
  testthat::skip_on_cran()
  testthat::expect_warning(
    module({
      library(modules)
    })
  )
  testthat::expect_warning(
    module({
      attach(list())
    })
  )
  testthat::expect_message(
    module({
      writeLines("", file <- tempfile())
      source(file)
    })
  )
})

Try the modules package in your browser

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

modules documentation built on Aug. 25, 2023, 5:17 p.m.