Skip to content

Commit

Permalink
Add a test that better reflects #130
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Sep 17, 2024
1 parent dab2351 commit 3f77c0b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Binary file added src/pause.gcda
Binary file not shown.
Binary file added src/profvis-init.gcda
Binary file not shown.
11 changes: 11 additions & 0 deletions tests/testthat/test-profvis.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ test_that("Irrelevant stack is trimmed from profiles (#123)", {
expect_equal(profile_mode(out), "pause f")
})

test_that("Irrelevant stack is trimmed from profiles from inlined code", {
skip_on_cran()
skip_on_covr()

out <- profvis(for (i in 1:1e4) rnorm(100), simplify = TRUE)
expect_equal(profile_mode(out), "rnorm")

out <- profvis(for (i in 1:1e4) rnorm(100), simplify = FALSE)
expect_equal(profile_mode(out), "rnorm")
})

test_that("defaults to elapsed timing", {
skip_on_cran()
skip_on_covr()
Expand Down

0 comments on commit 3f77c0b

Please sign in to comment.