Debian Codegraph @

tests/testthat/test-progress.R

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