inst/tests/test-MatrixOrMatrixList-class.R

context("MatrixOrMatrixList class")

test_that("MatrixOrMatrixList function works: list of Matrix", {
  foo <- MatrixOrMatrixList(list(Matrix(1), Matrix(2)))
  expect_is(foo, "MatrixList")
  expect_equal(length(foo), 2L)
})

test_that("MatrixOrMatrixList function works: single Matrix", {
  foo <- MatrixOrMatrixList(Matrix(1))
  expect_is(foo, "Matrix")
})

test_that("MatrixOrMatrixList function works: multiple Matrix args", {
  foo <- MatrixOrMatrixList(Matrix(1), Matrix(2))
  expect_is(foo, "MatrixList")
  expect_equal(length(foo), 2L)
})
jrnold/yakf documentation built on May 20, 2019, 2:06 a.m.