1 context("utils functions")
3 test_that("Helper function to split indices work properly",
7 # bigger nb_per_set than length(indices)
8 expect_equal(epclust:::.splitIndices(indices,500), list(indices))
10 # nb_per_set == length(indices)
11 expect_equal(epclust:::.splitIndices(indices,400), list(indices))
13 # length(indices) %% nb_per_set == 0
14 expect_equal(epclust:::.splitIndices(indices,200),
15 c( list(indices[1:200]), list(indices[201:400]) ))
16 expect_equal(epclust:::.splitIndices(indices,100),
17 c( list(indices[1:100]), list(indices[101:200]),
18 list(indices[201:300]), list(indices[301:400]) ))
20 # length(indices) / nb_per_set == 1, length(indices) %% nb_per_set == 100
21 expect_equal(epclust:::.splitIndices(indices,300), list(indices))
22 # length(indices) / nb_per_set == 2, length(indices) %% nb_per_set == 42
23 repartition <- epclust:::.splitIndices(indices,179)
24 expect_equal(length(repartition), 2)
25 expect_equal(length(repartition[[1]]), 179 + 21)
26 expect_equal(length(repartition[[1]]), 179 + 21)
29 test_that("curvesToContribs output correct results",
31 # curvesToContribs(...)