tests/testthat/test-check-consistency.R

context("test-consistency")

test_that("consistency errors", {
  expect_error(check_consistency("toto", matrix(0, c(1, 1)), matrix(0, 1)))
  expect_error(check_consistency(matrix(0, c(1, 1)), matrix(0, c(1, 1)), c(2)))
  expect_error(check_consistency(matrix(0, c(20, 1)), matrix(0, nrow = 20, ncol = 2), c(rep(0, 10), rep(1, 10))))
  expect_error(check_consistency(matrix(0, c(20, 1)), matrix(0, c(20, 1)), c(rep(0, 10), rep(1, 9))))
})

Try the scoringTools package in your browser

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

scoringTools documentation built on Jan. 13, 2021, 8:35 p.m.