tests/testthat/test-utils.R

test_that("warn_db", {
  expect_null(warn_db(list(), "foo"))
  expect_null(warn_db(NULL, "foo"))
  expect_null(warn_db(list(a = 5), "foo"))
  expect_null(warn_db(list(db = NULL), "foo"))
  expect_null(warn_db(list(db = "foo"), "foo"))
  expect_warning(warn_db(list(db = "bar"), "foo"),
    "'db' value 'bar' ignored; does not match dispatched method 'foo'")
})

Try the taxize package in your browser

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

taxize documentation built on Sept. 11, 2024, 6:13 p.m.