Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Nov 5, 2024
1 parent 039a14f commit fa6c5ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions tests/testthat/test-combine.R
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ test_that("can combine models that allow multiple parameters", {


test_that("Don't allow multiple parameters where either model lacks support", {
m <- ex_sir_filter_likelihood()
m <- ex_simple_gamma1()
m$properties$allow_multiple_parameters <- FALSE
p <- monty_dsl({
beta ~ Gamma(shape = 1, rate = 1 / 0.5)
gamma ~ Gamma(shape = 1, rate = 1 / 0.5)
Expand All @@ -300,10 +301,10 @@ test_that("Don't allow multiple parameters where either model lacks support", {

properties <- monty_model_properties(allow_multiple_parameters = FALSE)
expect_false(
monty_model_combine(m, p, properties)$allow_multiple_parmeters)
monty_model_combine(m, p, properties)$properties$allow_multiple_parameters)
properties <- monty_model_properties(allow_multiple_parameters = NULL)
expect_false(
monty_model_combine(m, p, properties)$allow_multiple_parmeters)
monty_model_combine(m, p, properties)$properties$allow_multiple_parameters)
properties <- monty_model_properties(allow_multiple_parameters = TRUE)
expect_error(
monty_model_combine(m, p, properties),
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-model.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ test_that("can create a minimal model", {
has_direct_sample = FALSE,
is_stochastic = FALSE,
has_observer = FALSE,
has_parameter_groups = FALSE))
has_parameter_groups = FALSE,
allow_multiple_parameters = FALSE))
expect_equal(m$domain, rbind(a = c(-Inf, Inf)))
expect_equal(m$parameters, "a")
expect_equal(m$density(0), dnorm(0, log = TRUE))
Expand Down

0 comments on commit fa6c5ca

Please sign in to comment.