tests/testthat/test-options.R

# Tests that the global options work as expected.
# library(testthat); library(basilisk); source("test-options.R")

test_that("global sharing option setting/getting works as expected", {
    out <- getBasiliskShared()
    expect_true(length(out)==1L && !is.na(out))

    setBasiliskShared(FALSE)
    expect_false(getBasiliskShared())

    setBasiliskShared(TRUE)
    expect_true(getBasiliskShared())

    setBasiliskShared(out)
})

test_that("global fork option setting/getting works as expected", {
    out <- getBasiliskFork()
    expect_true(length(out)==1L && !is.na(out))

    setBasiliskFork(FALSE)
    expect_false(getBasiliskFork())

    setBasiliskFork(TRUE)
    expect_true(getBasiliskFork())

    setBasiliskFork(out)
})

Try the basilisk package in your browser

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

basilisk documentation built on Dec. 18, 2020, 2 a.m.