tests/testthat/test-option_or_default.R

test_that("option_of_default works", {
  # value from list
  expect_equal(option_or_default(list("A" = 25), "A", 20), 25)
  
  # default value
  expect_equal(option_or_default(list("A" = 25), "B", 20), 20)
})

Try the saccadr package in your browser

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

saccadr documentation built on Sept. 8, 2023, 5:13 p.m.