Skip to content

Commit

Permalink
Test for case when time is specified but not present in the data
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmbaazam committed Sep 20, 2023
1 parent a9f4b00 commit a3cbf4a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/testthat/test-epichains.R
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,22 @@ test_that("aggregate.epichains method returns correct objects", {
)
})

test_that("aggregate.epichains method throws errors", {
expect_error(
aggregate(
simulate_tree(
nchains = 10,
statistic = "size",
offspring_dist = "pois",
stat_max = 10,
lambda = 2
),
grouping_var = "time"
),
"Object must have a time column"
)
})

test_that("aggregate.epichains method is numerically correct", {
set.seed(12)
#' Simulate a tree of infections without serials
Expand Down

0 comments on commit a3cbf4a

Please sign in to comment.