tests/testthat/test-significance_functions.R

context("test-significance_functions")

test_that("multiplication works", {
  expect_equal(2 * 2, 4)
})


# test_p_val_auc <- function(){
#   x <- 1:20
#   y <- c(rep(0, 10), rep(1, 10))
#   c(
#     #p-vals close to 0
#     are_equal(p_val_auc(x, y), 0, tol=1e-05),
#     #p-vals close to 1
#     are_equal(p_val_auc(rev(x), y), 1),
#     #equal imputs
#     are_equal(p_val_auc(rep(0,20), y), 1),
#     #wrong labels
#     has_error(p_val_auc(x, y+1), silent=T))
# }

test_that("p-value for AUC is 0", {
  expect_equal(p_val_auc(1:20, c(rep(0, 10), rep(1, 10))), 0, tolerance=.00001)
})
dinga92/neuromancr documentation built on June 18, 2019, 12:33 a.m.