tests/testthat/test-tune.R

test_that("tune creates a call", {
  expect_true(is.call(tune()))
  expect_true(is.call(tune("foo")))
})

test_that("tune `id` value", {
  expect_identical(tune(), call("tune"))
  expect_identical(tune(""), call("tune"))
  expect_identical(tune("foo"), call("tune", "foo"))
})

test_that("`id` is validated", {
  expect_error(tune(1), "The `id` should be a single character string.")
  expect_error(tune(c("x", "y")), "The `id` should be a single character string.")
  expect_error(tune(NA_character_), "The `id` can't be missing.")
})

Try the hardhat package in your browser

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

hardhat documentation built on March 31, 2023, 10:21 p.m.