Skip to content

Commit ef3d394

Browse files
committed
fix test
1 parent 55cb63e commit ef3d394

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/testthat/test-utils.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ test_that("check_divergences() works", {
1111
csv_files <- c(test_path("resources", "csv", "model1-2-no-warmup.csv"))
1212
csv_output <- read_cmdstan_csv(csv_files)
1313
output <- "14 of 100 \\(14.0%\\) transitions ended with a divergence."
14-
expect_message(check_divergences(csv_contents$post_warmup_sampler_diagnostics), output)
14+
expect_message(check_divergences(csv_output$post_warmup_sampler_diagnostics), output)
1515

1616
csv_files <- c(test_path("resources", "csv", "model1-2-no-warmup.csv"),
1717
test_path("resources", "csv", "model1-2-no-warmup.csv"))
1818
csv_output <- read_cmdstan_csv(csv_files)
1919
output <- "28 of 200 \\(14.0%\\) transitions ended with a divergence."
20-
expect_message(check_divergences(csv_contents$post_warmup_sampler_diagnostics), output)
20+
expect_message(check_divergences(csv_output$post_warmup_sampler_diagnostics), output)
2121

2222
csv_files <- c(test_path("resources", "csv", "model1-2-warmup.csv"))
2323
csv_output <- read_cmdstan_csv(csv_files)
2424
output <- "1 of 100 \\(1.0%\\) transitions ended with a divergence."
25-
expect_message(check_divergences(csv_contents$post_warmup_sampler_diagnostics), output)
25+
expect_message(check_divergences(csv_output$post_warmup_sampler_diagnostics), output)
2626

2727

2828
fit_wramup_no_samples <- testing_fit("logistic", method = "sample",
@@ -32,7 +32,7 @@ test_that("check_divergences() works", {
3232
save_warmup = TRUE,
3333
validate_csv = FALSE)
3434
csv_output <- read_cmdstan_csv(fit_wramup_no_samples$output_files())
35-
expect_message(check_divergences(csv_contents$post_warmup_sampler_diagnostics), regexp = NA)
35+
expect_message(check_divergences(csv_output$post_warmup_sampler_diagnostics), regexp = NA)
3636
})
3737

3838
test_that("check_sampler_transitions_treedepth() works", {
@@ -42,8 +42,8 @@ test_that("check_sampler_transitions_treedepth() works", {
4242
output <- "16 of 100 \\(16.0%\\) transitions hit the maximum treedepth limit of 5 or 2\\^5-1 leapfrog steps."
4343
expect_message(
4444
check_sampler_transitions_treedepth(
45-
csv_contents$post_warmup_sampler_diagnostics,
46-
csv_contents$metadata),
45+
csv_output$post_warmup_sampler_diagnostics,
46+
csv_output$metadata),
4747
output
4848
)
4949

@@ -53,8 +53,8 @@ test_that("check_sampler_transitions_treedepth() works", {
5353
output <- "32 of 200 \\(16.0%\\) transitions hit the maximum treedepth limit of 5 or 2\\^5-1 leapfrog steps."
5454
expect_message(
5555
check_sampler_transitions_treedepth(
56-
csv_contents$post_warmup_sampler_diagnostics,
57-
csv_contents$metadata),
56+
csv_output$post_warmup_sampler_diagnostics,
57+
csv_output$metadata),
5858
output
5959
)
6060

@@ -63,8 +63,8 @@ test_that("check_sampler_transitions_treedepth() works", {
6363
output <- "1 of 100 \\(1.0%\\) transitions hit the maximum treedepth limit of 5 or 2\\^5-1 leapfrog steps."
6464
expect_message(
6565
check_sampler_transitions_treedepth(
66-
csv_contents$post_warmup_sampler_diagnostics,
67-
csv_contents$metadata),
66+
csv_output$post_warmup_sampler_diagnostics,
67+
csv_output$metadata),
6868
output
6969
)
7070
})

0 commit comments

Comments
 (0)