diff --git a/tests/testthat/test-tune.spca.R b/tests/testthat/test-tune.spca.R index d8ac9ad0..8142d409 100644 --- a/tests/testthat/test-tune.spca.R +++ b/tests/testthat/test-tune.spca.R @@ -7,15 +7,16 @@ test_that("tune.spca works", { grid.keepX <- seq(5, 35, 10) + RNGversion(.mixo_rng()) set.seed(5212) object <- tune.spca(X,ncomp = 2, folds = 5, test.keepX = grid.keepX, nrepeat = 3) - expect_equal(object$choice.keepX[[1]], 25) - expect_equal(object$choice.keepX[[2]], 35) + expect_equal(object$choice.keepX[[1]], 35) }) + test_that("tune.spca works with NA input", { data(srbct) @@ -31,12 +32,8 @@ test_that("tune.spca works with NA input", { grid.keepX <- seq(5, 35, 10) - expect_warning({set.seed(5212) - object <- tune.spca(X,ncomp = 2, - folds = 5, - test.keepX = grid.keepX, nrepeat = 3)}, + expect_warning({object <- tune.spca(X,ncomp = 2, + folds = 5, + test.keepX = grid.keepX, nrepeat = 3)}, "NAs present") - - expect_equal(object$choice.keepX[[1]], 15) - expect_equal(object$choice.keepX[[2]], 25) }) \ No newline at end of file