From ef7b1d4df7564cf7cbe07d5d1f0c7e69c4956ff8 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Oct 2023 12:16:14 +0200 Subject: [PATCH] Update test-different_models.R --- tests/testthat/test-different_models.R | 49 ++++++++++++++++++++------ 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/tests/testthat/test-different_models.R b/tests/testthat/test-different_models.R index 4248c9770..bb57a5297 100644 --- a/tests/testthat/test-different_models.R +++ b/tests/testthat/test-different_models.R @@ -8,37 +8,64 @@ test_that("insight::get_predicted", { ) ) - rez <- point_estimate(x) + rez <- point_estimate(x, use_iterations = TRUE) expect_identical(c(nrow(rez), ncol(rez)), c(32L, 4L)) - rez <- hdi(x) + rez <- point_estimate(x, use_iterations = FALSE) + expect_identical(c(nrow(rez), ncol(rez)), c(1L, 3L)) + + rez <- hdi(x, use_iterations = TRUE) expect_identical(c(nrow(rez), ncol(rez)), c(32L, 4L)) - rez <- eti(x) + rez <- hdi(x, use_iterations = FALSE) + expect_identical(c(nrow(rez), ncol(rez)), c(1L, 3L)) + + rez <- eti(x, use_iterations = TRUE) expect_identical(c(nrow(rez), ncol(rez)), c(32L, 4L)) - rez <- ci(x) + rez <- eti(x, use_iterations = FALSE) + expect_identical(c(nrow(rez), ncol(rez)), c(1L, 3L)) + + rez <- ci(x, use_iterations = TRUE) expect_identical(c(nrow(rez), ncol(rez)), c(32L, 4L)) - rez <- map_estimate(x) + rez <- ci(x, use_iterations = FALSE) + expect_identical(c(nrow(rez), ncol(rez)), c(1L, 3L)) + + rez <- map_estimate(x, use_iterations = TRUE) expect_identical(c(nrow(rez), ncol(rez)), c(32L, 2L)) - rez <- p_direction(x) + rez <- map_estimate(x, use_iterations = FALSE) + expect_identical(c(nrow(rez), ncol(rez)), c(1L, 2L)) + + rez <- p_direction(x, use_iterations = TRUE) expect_identical(c(nrow(rez), ncol(rez)), c(32L, 2L)) - rez <- p_map(x) + rez <- p_direction(x, use_iterations = FALSE) expect_identical(c(nrow(rez), ncol(rez)), c(1L, 2L)) - rez <- p_significance(x) + rez <- p_map(x, use_iterations = TRUE) + expect_identical(c(nrow(rez), ncol(rez)), c(32L, 2L)) + + rez <- p_map(x, use_iterations = FALSE) expect_identical(c(nrow(rez), ncol(rez)), c(1L, 2L)) - rez <- rope(x) + rez <- p_significance(x, use_iterations = TRUE) + expect_identical(c(nrow(rez), ncol(rez)), c(32L, 2L)) + + rez <- p_significance(x, use_iterations = FALSE) + expect_identical(c(nrow(rez), ncol(rez)), c(1L, 2L)) + + rez <- rope(x, use_iterations = TRUE) + expect_identical(c(nrow(rez), ncol(rez)), c(32L, 5L)) + + rez <- rope(x, use_iterations = FALSE) expect_identical(c(nrow(rez), ncol(rez)), c(1L, 4L)) - rez <- describe_posterior(x) + rez <- describe_posterior(x, use_iterations = TRUE) expect_identical(c(nrow(rez), ncol(rez)), c(32L, 5L)) - rez <- estimate_density(x) + rez <- estimate_density(x, use_iterations = TRUE) expect_identical(c(nrow(rez), ncol(rez)), c(1024L, 2L)) })