tests/testthat/test-print.R

test_that("print", {

  px <- get_tool("px")
  p <- process$new(px, c("sleep", "5"))
  on.exit(try_silently(p$kill(grace = 0)), add = TRUE)
  expect_output(
    print(p),
    "PROCESS .* running, pid"
  )

  p$kill()
  expect_output(
    print(p),
    "PROCESS .* finished"
  )
})

Try the processx package in your browser

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

processx documentation built on May 29, 2024, 5:53 a.m.