Revision d2eac42f58e4e0f0d07298e8c2e719ef6a30672d authored by Dominique Makowski on 19 June 2020, 08:00:07 UTC, committed by cran-robot on 19 June 2020, 08:00:07 UTC
1 parent 01482dc
Raw File
test-mhdior.R
context("mhdior")

test_that("mhdior", {
  testthat::expect_equal(as.numeric(mhdior(x = distribution_normal(1000, mean = 5, sd = 1), range = c(-0.1, 0.1))), 1, tolerance = 0.01)
  testthat::expect_equal(as.numeric(mhdior(x = distribution_normal(1000, mean = 1, sd = 1), range = c(-0.1, 0.1))), 0.631, tolerance = 0.01)
  testthat::expect_equal(as.numeric(mhdior(x = distribution_normal(1000, mean = -1, sd = 1), range = c(-0.1, 0.1))), 0.631, tolerance = 0.01)
  testthat::expect_equal(as.numeric(mhdior(x = distribution_normal(1000, mean = 0, sd = 1), range = c(-0.1, 0.1))), -0.079, tolerance = 0.01)
  testthat::expect_equal(as.numeric(mhdior(x = distribution_normal(1000, mean = 0, sd = 0.01), range = c(-0.1, 0.1))), -1, tolerance = 0.01)
})
back to top