tests/testthat/test_MsBackend-functions.R

test_that(".valid_ms_backend_data_storage works", {
    expect_match(.valid_ms_backend_data_storage(c("a", NA)), "not allowed")
    expect_null(.valid_ms_backend_data_storage(character()))
    expect_null(.valid_ms_backend_data_storage("b"))
})

test_that(".valid_ms_backend_files_exist", {
    expect_match(.valid_ms_backend_files_exist(c("a", "b")), "a, b not")
    tmpf <- tempfile()
    write("hello", file = tmpf)
    expect_null(.valid_ms_backend_files_exist(tmpf))
    expect_null(.valid_ms_backend_files_exist(character()))
    expect_null(.valid_ms_backend_files_exist(NA_character_))
})

Try the Spectra package in your browser

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

Spectra documentation built on Nov. 27, 2020, 2 a.m.