Skip to content

Commit

Permalink
Added unit tests for func_MCMC_graph() (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
wleoncio committed Aug 15, 2024
1 parent e93f4bb commit 5fb4e4a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/testthat/test-func_MCMC_graph_cpp.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@ BayesSurvive_wrap <- function(use_cpp = FALSE) {
}
fit_R <- BayesSurvive_wrap(use_cpp = FALSE)
fit_C <- BayesSurvive_wrap(use_cpp = TRUE)

test_that("R and C++ objects are similar", {
expect_equal(fit_R$call, fit_C$call)
expect_equal(fit_R$input, fit_C$input)
for (obj in names(fit_R$output)[2]) {
expect_equal(fit_R$output[[obj]], fit_C$output[[obj]], tolerance = 1)
}
})

0 comments on commit 5fb4e4a

Please sign in to comment.