tests/testthat/test-tar_debug_instructions.R

tar_test("tar_debug_instructions()", {
  on.exit(tar_runtime$target <- NULL)
  targets <- list(
    tar_target(a, g(a)),
    tar_target(a, b),
    tar_target(a, NULL)
  )
  for (target in targets) {
    tar_runtime$target <- target
    target$command$expr <- as.expression(
      list(
        instructions = quote(targets::tar_debug_instructions()),
        browser = quote(browser()),
        expr = target$command$expr
      )
    )
    suppressMessages(expect_message(tar_debug_instructions()))
  }
})

Try the targets package in your browser

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

targets documentation built on Oct. 12, 2023, 5:07 p.m.