Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 30, 2023
1 parent 0f2bd5b commit 29dfe5f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test_that("ci", {
expect_equal(ci(distribution_normal(1000), ci = 0.90)$CI_low[1], -1.6361, tolerance = 0.02)
expect_equal(nrow(ci(distribution_normal(1000), ci = c(0.80, 0.90, 0.95))), 3, tolerance = 0.01)
expect_equal(ci(distribution_normal(1000), ci = 1)$CI_low[1], -3.29, tolerance = 0.02)
expect_equal(length(capture.output(print(ci(distribution_normal(1000), ci = c(.80, .90))))))
expect_length(capture.output(print(ci(distribution_normal(1000), ci = c(0.80, 0.90)))), 5)

expect_equal(ci(c(2, 3, NA))$CI_low, 2.02, tolerance = 1e-2)
expect_warning(ci(c(2, 3)))
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-format.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ test_that("p_significance", {
)
expect_equal(
format(map_estimate(x)),
data.frame(x = "0.13", stringsAsFactors = FALSE),
data.frame(MAP_Estimate = "0.13", stringsAsFactors = FALSE),
ignore_attr = TRUE
)
expect_equal(
format(p_direction(x)),
data.frame(x = "51.00%", stringsAsFactors = FALSE),
data.frame(Parameter = "Posterior", pd = "51.00%", stringsAsFactors = FALSE),
ignore_attr = TRUE
)
expect_equal(
format(p_map(x)),
data.frame(x = "0.973", stringsAsFactors = FALSE),
data.frame(Parameter = "Posterior", p_MAP = "0.973", stringsAsFactors = FALSE),
ignore_attr = TRUE
)
expect_equal(
format(p_significance(x)),
data.frame(x = "0.46", stringsAsFactors = FALSE),
data.frame(Parameter = "Posterior", ps = "0.46", stringsAsFactors = FALSE),
ignore_attr = TRUE
)
expect_equal(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-p_significance.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_that("p_significance", {
expect_equal(as.numeric(ps), 0.816, tolerance = 0.1)
expect_s3_class(ps, "p_significance")
expect_s3_class(ps, "data.frame")
expect_identical(dim(ps), c(1L, 1L))
expect_identical(dim(ps), c(1L, 2L))
expect_identical(
capture.output(print(ps)),
c(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-rope_range.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test_that("rope_range", {
})

test_that("rope_range (multivariate)", {
skip_if_not_or_load_if_installed("brms")
model <- suppressWarnings(
brms::brm(brms::bf(mvbind(mpg, disp) ~ wt + gear) + brms::set_rescor(TRUE), data = mtcars, iter = 300)
)
Expand Down

0 comments on commit 29dfe5f

Please sign in to comment.