Debian Codegraph @

tests/test-cran/test-command.R

raw
1 library(testit)
2
3 assert("Rscript() correctly calls Rscript with system2()", {
4 (Rscript(c("-e", "1+1"), stdout = TRUE) %==% "[1] 2")
5 })
6
7 assert("Rscript_call() correctly calls Rscript()", {
8 (Rscript_call(function() 1+1) %==% 2)
9 loaded = Rscript_call(
10 function() loadedNamespaces(), options = "--default-packages=xfun"
11 )
12 ("xfun" %in% loaded)
13 })