dwww Home | Show directory contents | Find package

context("Garbage collection")

test_that("callbacks are protected", {
  progress <- function(down, up) { TRUE }
  h <- new_handle(progressfunction = progress, noprogress = FALSE)
  rm(progress)
  gc()
  res <- curl_fetch_memory("https://cloud.r-project.org/web/packages/curl/curl.pdf", handle = h)
  expect_equal(res$status, 200)
  expect_equal(total_handles(), 1L)
  rm(h)
  gc()
  expect_equal(total_handles(), 0L)
})

Generated by dwww version 1.15 on Wed Jun 26 01:29:01 CEST 2024.