tests/testthat/test-favor.R

test_that("trailing () is optional", {
  withr::defer(prefs_reset())

  expect_snapshot({
    conflicts_prefer(
      dplyr::lag,
      dplyr::filter()
    )
  })
})

test_that("errors if invalid form", {
  expect_snapshot(error = TRUE, {
    conflicts_prefer(1)
    conflicts_prefer(foo())
    conflicts_prefer(dplyr::filter(a = 1))
  })
})

Try the conflicted package in your browser

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

conflicted documentation built on Feb. 16, 2023, 6:05 p.m.