Skip to content

Commit

Permalink
Update test for new methods
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Jan 11, 2024
1 parent 790bf59 commit 00ca320
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/testthat/test-fit-shared.R
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ test_that("CmdStanArgs erorrs if idx is out of proc_ids range", {
)
})

test_that("no output with refresh = 0", {
test_that("no output with show_messages = FALSE", {
mod <- testing_model("logistic")
data_list <- testing_data("logistic")
output <- utils::capture.output(tmp <- mod$variational(data = data_list, seed = 123))
Expand All @@ -298,12 +298,12 @@ test_that("no output with refresh = 0", {
output <- utils::capture.output(tmp <- mod$sample(data = data_list, chains = 1, seed = 123))
expect_gt(length(output), 1)

output <- utils::capture.output(tmp <- mod$variational(data = data_list, refresh = 0, seed = 123))
expect_equal(length(output), 1)
output <- utils::capture.output(tmp <- mod$optimize(data = data_list, refresh = 0, seed = 123))
expect_equal(length(output), 1)
output <- utils::capture.output(tmp <- mod$sample(data = data_list, refresh = 0, chains = 1, seed = 123))
expect_equal(length(output), 3)
output <- utils::capture.output(tmp <- mod$variational(data = data_list, show_messages = FALSE, seed = 123))
expect_equal(length(output), 0)
output <- utils::capture.output(tmp <- mod$optimize(data = data_list, show_messages = FALSE, seed = 123))
expect_equal(length(output), 0)
output <- utils::capture.output(tmp <- mod$sample(data = data_list, show_messages = FALSE, chains = 1, seed = 123))
expect_equal(length(output), 0)
})

test_that("sig_figs works with all methods", {
Expand Down

0 comments on commit 00ca320

Please sign in to comment.