Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 14, 2023
1 parent 04ff86a commit 5111d92
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/test-data_rescale.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ test_that("data_rescale can expand range", {
expect_equal(rescale(x, multiply = 1.1), rescale(x, add = 1), ignore_attr = TRUE)
expect_error(rescale(x, multiply = 0.9, add = 1), regex = "Only one of")

# works with NA
expect_equal(
rescale(rep(NA_real_, 3), multiply = 1.1),
rep(NA_real_, 3),
ignore_attr = TRUE
)
expect_equal(
rescale(rep(NA_real_, 3), add = 2),
rep(NA_real_, 3),
ignore_attr = TRUE
)

# for data frames
d <- data.frame(x = 5:15, y = 5:15)
expect_equal(
Expand Down

0 comments on commit 5111d92

Please sign in to comment.