2 test.connexity1 = function()
5 NIix = as.list(rep(NA,n))
6 #connect 0 with 1, 2 with 3 ...
7 for (i in 2*(0:(n/2-1)) + 1)
12 cc = synclust:::getConnectedComponents(NIix)
13 #cc should contain exactly n/2 integers
14 checkEquals(n/2, length(unique(cc)))
18 test.connexity2 = function()
21 NIix = as.list(rep(NA,n))
22 #connect 0 with 1, 1 with 2 ...
24 NIix[[i]] = c(ifelse(i==1,n,i-1), i%%n+1)
25 cc = synclust:::getConnectedComponents(NIix)
26 #cc should contain only one integer (1)
27 checkEquals(1, length(unique(cc)))
30 #custom graph with 3 connex components
31 test.connexity3 = function()
34 NIix = as.list(rep(0,n))
45 cc = synclust:::getConnectedComponents(NIix)
46 #cc should contain only three integers
47 checkEquals(3, length(unique(cc)))
50 #custom graph, 1 connex component
51 test.connexity4 = function()
54 NIix = as.list(rep(0,n))
58 NIix[[4]] = c(1,6,9,10)
65 cc = synclust:::getConnectedComponents(NIix)
66 #cc should contain only one integer (1)
67 checkEquals(1, length(unique(cc)))