tests/testthat/test-example_lambda.R

test_that("input and output length match", {
  expect_length(example_lambda(seq(0,100, length.out = 20), height = 100), 20)
})

test_that("output length is 0 when input is numeric(0)", {
  expect_length(example_lambda(numeric(0), height = 100) , 0)
})

test_that("output is NA when input is NA", {
  expect_true(is.na(example_lambda(c(NA, 1), height = 100)[1]))
})

test_that("result is non-negative", {
  expect_true(all(example_lambda(seq(0,100, length.out = 20), height = 100) >= 0))
})
PeteyCoco/ppdeconv documentation built on March 21, 2022, 5:35 a.m.