Skip to content

Commit

Permalink
more robust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mnwright committed Jan 19, 2024
1 parent b784680 commit 32b8e7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-return_types.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test_that("FORDE categories sum to unity", {
arf <- adversarial_rf(iris, num_trees = 2, verbose = FALSE, parallel = FALSE)
psi <- forde(arf, iris, parallel = FALSE)
tmp <- psi$cat[, sum(prob), by = f_idx]
expect_true(all.equal(tmp$V1, rep(1, times = tmp[, .N])))
expect_equal(tmp$V1, rep(1, times = tmp[, .N]))
})

test_that("Likelihood calculation returns vector of log-likelihoods", {
Expand All @@ -30,7 +30,7 @@ test_that("Likelihood calculation returns vector of log-likelihoods", {
expect_type(loglik, "double")
expect_length(loglik, nrow(iris))
expect_true(all(!is.na(loglik)))
expect_true(all.equal(loglik, loglik2))
expect_equal(loglik, loglik2)
})

test_that("FORGE returns data frame when called with data frame", {
Expand Down

0 comments on commit 32b8e7c

Please sign in to comment.