tests/testthat/test-profvis.R

skip_on_cran_if_not_ci()

test_that("Irrelevant stack is trimmed from profiles (#123)", {
  f <- function() pause(TEST_PAUSE_TIME)

  out <- repro_profvis(f(), simplify = FALSE)
  expect_equal(profvis_modal_value(out$x$message$prof), "pause f")

  out <- profvis(f(), simplify = TRUE, rerun = "pause", interval = 0.005)
  expect_equal(profvis_modal_value(out$x$message$prof), "pause f")

  out <- repro_profvis(f(), simplify = TRUE)
  expect_equal(profvis_modal_value(out$x$message$prof), "pause f")
})

Try the profvis package in your browser

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

profvis documentation built on May 3, 2023, 1:19 a.m.