tests/t-random.R

source(file.path("_helper", "init.R"))

# - "random seed" --------------------------------------------------------------

dir <- file.path(TMP.DIR, "randdir")
dir.create(dir)
file <- file.path(dir, "randtest.R")
cat("sample(1:100)\n", file = file)
set.seed(1)
coi(unitize(file, auto.accept = "new"))
# changing seed should have no effect on result
set.seed(23)
coi(res <- unitize(file))
# expect_equal(as.character(res$status), "Passed")
as.character(res$status)

Try the unitizer package in your browser

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

unitizer documentation built on Oct. 8, 2023, 5:06 p.m.