tests/testthat/test-pprof-from-ds.R

context("pprof-from-ds")

test_that("roundtrip works", {
  skip_if_not_installed("RProtoBuf")

  ds <- read_inst_pprof("proto/1.out.prof.pb.gz")
  # Validating on convert

  ds1 <- msg_to_ds(ds_to_msg(ds))
  # Validating on convert
  ds2 <- msg_to_ds(ds_to_msg(ds1))
  expect_error(validate_profile(ds2), NA)

  expect_identical(strip_dots(ds1), strip_dots(ds2))
})

Try the profile package in your browser

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

profile documentation built on Aug. 22, 2022, 9:10 a.m.