From 5111d929ddb455090248d7626c2910f8bc03e83a Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 14 Nov 2023 09:20:24 +0100 Subject: [PATCH] test --- tests/testthat/test-data_rescale.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/testthat/test-data_rescale.R b/tests/testthat/test-data_rescale.R index e0db32a01..53154b5da 100644 --- a/tests/testthat/test-data_rescale.R +++ b/tests/testthat/test-data_rescale.R @@ -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(