Skip to content

Commit

Permalink
Add missing test for summary.epichains_summary method
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmbaazam committed May 30, 2024
1 parent 2c85a40 commit ad8f37b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testthat/test-epichains.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ test_that("summary.epichains works as expected", {
#' Simulate the length statistic for the same outbreak
set.seed(32)
chain_length_summary_sim <- simulate_chain_stats_default(statistic = "length")
# Simulate chain summaries that are all Inf
set.seed(32)
chain_size_stats_all_Infs <- simulate_chain_stats_default(
stat_threshold = 1
)
chain_size_stats_all_Infs_summary <- summary(chain_size_stats_all_Infs)
#' Expect the results from the tree and the summary to be the same
expect_true(
identical(
Expand Down Expand Up @@ -241,6 +247,14 @@ test_that("summary.epichains works as expected", {
chain_length_summary_sim
)
)
expect_identical(
chain_size_stats_all_Infs_summary$max_stat,
Inf
)
expect_identical(
chain_size_stats_all_Infs_summary$min_stat,
Inf
)
})

test_that("validate_epichains works", {
Expand Down

0 comments on commit ad8f37b

Please sign in to comment.