Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosbosse committed Nov 2, 2023
1 parent 7ae2a40 commit 16c9297
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testthat/test-lower-level-check-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,16 @@ test_that("function throws an error for wrong format of predictions", {
fixed = TRUE
)
})


test_that("Function throws an error if all values are `NA`", {
observed <- factor(sample(c(0, 1), size = 10, replace = TRUE))
predicted <- rep(NA, 10)
expect_error(
brier_score(
observed = observed,
predicted = predicted
),
"Assertion on 'predicted' failed: All values are NA."
)
})

0 comments on commit 16c9297

Please sign in to comment.