tests/testthat/helper-filter-dm.R

expect_pred_chain <- function(fc, chain) {
  # Check that node is unique
  expect_true(identical(fc$node, unique(fc$node)))

  filtered_fc <-
    fc %>%
    filter(node %in% !!chain)

  # Beware of https://github.com/r-lib/testthat/issues/929
  expect_equal(filtered_fc$node, !!chain)
}

expect_not_pred <- function(fc, node) {
  # Check that node is missing
  expect_false(any(node %in% fc$node))
}

Try the dm package in your browser

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

dm documentation built on Nov. 2, 2023, 6:07 p.m.