tests/testthat/test-rblockmult.R

test_that("rblockmult works correctly", {
    ## expect_that( rblockmult(matrix(1, nrow = 4, ncol = 10),
    ##                         matrix(1, nrow = 4, ncol = 4))
    ##             , throws_error())

    expect_error( rblockmult(matrix(1, nrow = 4, ncol = 10),
                             matrix(1, nrow = 4, ncol = 4))
                 )

    x <- matrix(1, nrow = 4, ncol = 12)
    b <- diag(4)
    expect_that(rblockmult(x, b), equals(x))

})

Try the mcompanion package in your browser

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

mcompanion documentation built on May 29, 2024, 4:31 a.m.