tests/testthat/test-valgrind.R

test_that("memory leak test", {
  expect_error(cheapr_do_memory_leak_test()) # No memory leak should happen here
  # expect_error(cheapr_unsafe_init_memory_leak()) # This SHOULD cause a memory leak
})

Try the cheapr package in your browser

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

cheapr documentation built on Jan. 8, 2026, 5:09 p.m.