tests/testthat/test-dgood.R

test_that("non-positive x result", {
   expect_equal(dgood ( x = -3 , z = 0.6 , s = -3 ), 0)
})
#> Test passed

test_that("non-positive x warning", {
  expect_warning(dgood ( x = -3 , z = 0.6 , s = -3 ))
})
#> Test passed

test_that("z outside (0, 1) x result", {
  expect_equal(dgood ( x = -3 , z = -0.9 , s = -3 ), NaN)
})
#> Test passed

test_that("z outside (0, 1) warning", {
  expect_warning(dgood ( x = 4 , z = -0.9 , s = -3 ))
})
#> Test passed

test_that("approximation", {
  expect_warning(dgood ( x = 330 : 331 , z = c ( 0.6 , 0.5 ) , s = -170 ))
}) 
#> Test passed

Try the good package in your browser

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

good documentation built on May 29, 2024, 11:50 a.m.