tests/testthat/test-12_flow_view_source_calls.R

test_that("flow_view_source_calls", {
  tmp <- tempdir()
  writeLines("source('B.R')\nsource('C.R')", file.path(tmp, "A.R"))
  writeLines("source('D.R')", file.path(tmp, "B.R"))
  writeLines("print('hello')", file.path(tmp, "C.R"))
  writeLines("print('hello')", file.path(tmp, "D.R"))
  expect_snapshot({
    flow_view_source_calls(tmp, out = "data")
  })
  file.remove(
    file.path(tmp, "A.R"),
    file.path(tmp, "B.R"),
    file.path(tmp, "C.R"),
    file.path(tmp, "D.R")
  )
})

Try the flow package in your browser

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

flow documentation built on June 7, 2023, 5:17 p.m.