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 c598a17 commit b81dd92
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/testthat/test-p_direction.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ test_that("p_direction", {
expect_equal(as.numeric(p_direction(x, method = "kernel")), 0.842, tolerance = 0.1)
expect_s3_class(pd, "p_direction")
expect_s3_class(pd, "data.frame")
expect_equal(dim(pd), c(1L, 1L))
expect_output(print(pd), regexp = "Probability of Direction: 84.13%", fixed = TRUE)
expect_identical(dim(pd), c(1L, 2L))
expect_identical(
capture.output(print(pd)),
c(
"Probability of Direction", "", "Parameter | pd", "------------------",
"Posterior | 84.13%"
)
)

df <- data.frame(replicate(4, rnorm(100)))
pd <- p_direction(df)
expect_s3_class(pd, "p_direction")
expect_s3_class(pd, "data.frame")
expect_equal(dim(pd), c(4, 2))
expect_identical(dim(pd), c(4L, 2L))
})


Expand Down

0 comments on commit b81dd92

Please sign in to comment.