tests/testthat/test-matrix_sum.R

test_that("matrix sum returns and error if its not a matrix", {
  x <- matrix(1, 2, 2)
  y <- "hello"

  expect_equal(matrix_sum(x), 4)


  expect_error(matrix_sum(y), "Not a matrix!")

  })
bios2/netwerq documentation built on Dec. 19, 2021, 9:47 a.m.