From 14cb619997719aac2971b5ef89feacc421764458 Mon Sep 17 00:00:00 2001 From: Chris Sobczak Date: Wed, 10 Jun 2026 20:54:26 -0700 Subject: Update docs --- tests/testthat/test-rsc.R | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/testthat/test-rsc.R (limited to 'tests/testthat') diff --git a/tests/testthat/test-rsc.R b/tests/testthat/test-rsc.R new file mode 100644 index 0000000..e392bb5 --- /dev/null +++ b/tests/testthat/test-rsc.R @@ -0,0 +1,19 @@ +test_that("rsc unchanged when weights = NULL", { + set.seed(1) + p <- 10 + X <- matrix(rnorm(p * p), p) + cv <- rsc_cv(X, ncores = 1) + R1 <- rsc(cv) + R2 <- rsc(cv, weights = NULL) + expect_equal(R1, R2) +}) + +test_that("if given weights of all 1 of the right dimensions, rsc should be unchanged", { + set.seed(1) + p <- 10 + X <- matrix(rnorm(p * p), p) + cv <- rsc_cv(X, ncores = 1) + R1 <- rsc(cv) + R2 <- rsc(cv, weights = matrix(data = 1, ncol = p, nrow = p)) + expect_equal(R1, R2) +}) -- cgit v1.2.3