tests/testthat/test-parModel.R

library(testthat)
library(xegaSelectGene)
library(xegaGaGene)
library(xegaPopulation)

#test_that("MClapply OK",
#  {
#        skip_on_cran()
#	pop<-xegaInitPopulation(1000, lFxegaGaGene)
#        npop0<-lapply(pop, lFxegaGaGene$EvalGene, lFxegaGaGene)
#        npop1<-MClapply(pop, lFxegaGaGene$EvalGene, lFxegaGaGene)
#        expect_identical(npop0, npop1)
#  })

test_that("ApplyFactory OK",
          {
          Fun<-ApplyFactory()
          expect_identical(body(Fun), body(base::lapply))
          Fun<-ApplyFactory("Sequential")
          expect_identical(body(Fun), body(base::lapply))
          Fun<-ApplyFactory("MultiCore")
          expect_identical(body(Fun), body(MClapply))
          #Fun<-ApplyFactory("FutureMultiCore")
          #expect_identical(body(Fun), body(lapplyMCFuture))
          Fun<-ApplyFactory("Cluster")
          expect_identical(body(Fun), body(PparLapply))
          expect_error(ApplyFactory("Stchastic"))
          }
)

Try the xegaPopulation package in your browser

Any scripts or data that you put into this service are public.

xegaPopulation documentation built on Aug. 22, 2025, 5:14 p.m.