Skip to content

Commit

Permalink
Add checks to test-lfmcmc, -sir, -sirconn, -sird, -sis for unexpected…
Browse files Browse the repository at this point in the history
… inheritance
  • Loading branch information
apulsipher committed Nov 14, 2024
1 parent cd3f06f commit 58b8487
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions inst/tinytest/test-lfmcmc.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ expect_silent(lfmcmc_model <- LFMCMC(model_sir))

# Check initialization
expect_inherits(lfmcmc_model, "epiworld_lfmcmc")
expect_length(class(lfmcmc_model), 1)

# Extract observed data from the model
obs_data <- unname(as.integer(get_today_total(model_sir)))
Expand Down
1 change: 1 addition & 0 deletions inst/tinytest/test-sir.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ expect_silent(sir_0 <- ModelSIR(
# Check model initialization
expect_inherits(sir_0, "epiworld_sir")
expect_inherits(sir_0, "epiworld_model")
expect_length(class(sir_0), 2)
expect_silent(agents_smallworld(
sir_0,
n = 50000,
Expand Down
1 change: 1 addition & 0 deletions inst/tinytest/test-sirconn.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ expect_silent(sirconn_0 <- ModelSIRCONN(
# Check model initialization
expect_inherits(sirconn_0, "epiworld_sirconn")
expect_inherits(sirconn_0, "epiworld_model")
expect_length(class(sirconn_0), 2)

# Check model run with queuing -------------------------------------------------
expect_silent(verbose_off(sirconn_0))
Expand Down
1 change: 1 addition & 0 deletions inst/tinytest/test-sird.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ expect_silent(sird_0 <- ModelSIRD(
# Check model initialization
expect_inherits(sird_0, "epiworld_sird")
expect_inherits(sird_0, "epiworld_model")
expect_length(class(sird_0), 2)
expect_silent(agents_smallworld(
sird_0,
n = 10000,
Expand Down
1 change: 1 addition & 0 deletions inst/tinytest/test-sis.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ expect_silent(sis_0 <- ModelSIS(
# Check model initialization
expect_inherits(sis_0, "epiworld_sis")
expect_inherits(sis_0, "epiworld_model")
expect_length(class(sis_0), 2)
expect_silent(agents_smallworld(
sis_0,
n = 2000,
Expand Down

0 comments on commit 58b8487

Please sign in to comment.