From 09affc78fd98046148410ae7a268d70aa0b35e74 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 20 Jul 2024 14:28:07 +0200 Subject: [PATCH] add test --- tests/testthat/test-equivalence_test.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/testthat/test-equivalence_test.R b/tests/testthat/test-equivalence_test.R index cd9ab72bb..1dc4635e7 100644 --- a/tests/testthat/test-equivalence_test.R +++ b/tests/testthat/test-equivalence_test.R @@ -7,3 +7,15 @@ test_that("equivalence_test", { expect_type(capture.output(equivalence_test(m)), "character") expect_snapshot(print(x)) }) + +test_that("equivalence_test, unequal rope-range", { + data(iris) + m <- lm(Sepal.Length ~ Species, data=iris) + rez <- equivalence_test(m, range = c(-Inf, 0.1)) + expect_identical(rez$ROPE_Equivalence, c("Rejected", "Rejected", "Rejected")) + expect_identical(rez$ROPE_low, c(-Inf, -Inf, -Inf)) + + rez <- equivalence_test(m, range = c(-99, 0.1)) + expect_identical(rez$ROPE_Equivalence, c("Rejected", "Rejected", "Rejected")) + expect_identical(rez$ROPE_low, c(-99, -99, -99)) +})