Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 20, 2024
1 parent e9eaaba commit 09affc7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/test-equivalence_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 13 in tests/testthat/test-equivalence_test.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-equivalence_test.R,line=13,col=39,[infix_spaces_linter] Put spaces around all infix operators.
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))
})

0 comments on commit 09affc7

Please sign in to comment.