tests/testthat/test-getCluster.R

context("getCluster")

test_that("getCluster faild on invalid input", {
    # string
    expect_error(getCluster("abc"))
    
    # integer
    expect_error(getCluster(1))
    
    # matrix
    expect_error(getCluster(matrix(1:9, ncol = 3)))
})

demo <- suppressWarnings(get_demo_cluster())


test_that("getCluster works and return a valid output", {
    for(i in c("pca", "spca", "pls", "spls", "block.pls", "block.spls")){
        expect_is(getCluster(demo[[i]]), "data.frame")
    }
})

Try the timeOmics package in your browser

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

timeOmics documentation built on Nov. 8, 2020, 10:58 p.m.