summaryrefslogtreecommitdiff
path: root/tests/testthat/test-rsc.R
blob: e392bb56dc4a794f4b226bc324930425c12ffd80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)
})