Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Nov 1, 2023
1 parent 02d42d9 commit f386040
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/testthat/test-bounds.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ test_that("scaling is possible with NULL values", {
expect_null(rescale_mid(NULL))
})

test_that("rescaling does not alter AsIs objects", {
expect_identical(I(1:3), rescale(I(1:3), from = c(0, 4)))
expect_identical(I(1:3), rescale_mid(I(1:3), from = c(0, 4), mid = 1))
})

test_that("scaling is possible with logical values", {
expect_equal(rescale(c(FALSE, TRUE)), c(0, 1))
expect_equal(rescale_mid(c(FALSE, TRUE), mid = 0.5), c(0, 1))
Expand Down

0 comments on commit f386040

Please sign in to comment.