Skip to content

Commit 037fef2

Browse files
committed
Add a test
1 parent d110c38 commit 037fef2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/testthat/test-extractors.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,12 @@ test_that("cmdstanr methods work", {
136136
ratio <- neff_ratio(fit)
137137
expect_named(head(ratio, 4), c("alpha", "beta[1]", "beta[2]", "beta[3]"))
138138
expect_true(all(ratio > 0))
139+
140+
# https://github.com/stan-dev/bayesplot/pull/535
141+
np_one <- nuts_params(fit, pars = "divergent__")
142+
expect_identical(levels(np_one$Parameter), "divergent__")
143+
expect_true(all(np_one$Parameter == "divergent__"))
144+
expect_equal(range(np_one$Iteration), c(1, 500))
145+
expect_equal(range(np_one$Chain), c(1, 2))
146+
expect_true(all(np_one$Value == 0))
139147
})

0 commit comments

Comments
 (0)