tests/testthat/test-as-methods.R

library("testthat")
library("permute")

context("Testing as.foo() methods")

test_that("as.matrix allPerms method", {
    ap <- allPerms(1:3)
    m <- as.matrix(ap)
    expect_is(m, "matrix")
    expect_false(inherits(m, "allPerms"))
})

test_that("as.matrix permutationMatrix method", {
    perms <- shuffleSet(10, nset = 10)
    m <- as.matrix(perms)
    expect_is(m, "matrix")
    expect_false(inherits(m, "permutationMatrix"))
})

test_that("as.allPerms fixes #16", {
    res1 <- check(4, control = how())
    ctrl <- getControl(res1)
    res <- check(4, ctrl)
    expect_is(res, "check")
})

Try the permute package in your browser

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

permute documentation built on March 18, 2022, 7:36 p.m.