From b81dd9212b8231db1f3904bec6326b8419607069 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 30 Sep 2023 09:10:48 +0200 Subject: [PATCH] fix test --- tests/testthat/test-p_direction.R | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-p_direction.R b/tests/testthat/test-p_direction.R index 6d38d0d7c..226c5bb9f 100644 --- a/tests/testthat/test-p_direction.R +++ b/tests/testthat/test-p_direction.R @@ -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)) })