Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 30, 2023
1 parent c532d69 commit c598a17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions tests/testthat/test-p_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ test_that("p_map", {
expect_equal(as.numeric(pmap), 0.9285376, tolerance = 0.001)
expect_s3_class(pmap, "p_map")
expect_s3_class(pmap, "data.frame")
expect_equal(dim(pmap), c(1, 1))
expect_output(print(pmap), "MAP-based p-value: 0.929")
expect_identical(dim(pmap), c(1L, 2L))
expect_identical(
capture.output(print(pmap)),
c(
"MAP-based p-value", "", "Parameter | p (MAP)",
"-------------------", "Posterior | 0.929"
)
)

expect_equal(as.numeric(p_map(distribution_normal(1000))), 1, tolerance = 0.1)
expect_equal(as.numeric(p_map(distribution_normal(1000, 1, 1))), 0.62, tolerance = 0.1)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-p_significance.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ test_that("p_significance", {
expect_s3_class(ps, "p_significance")
expect_s3_class(ps, "data.frame")
expect_identical(dim(ps), c(1L, 1L))
expect_output(
print(ps),
expect_identical(
capture.output(print(ps)),
c(
"Practical Significance (threshold: 0.10)",
"",
Expand Down

0 comments on commit c598a17

Please sign in to comment.