tests/testthat/test-matrix_sum.R

## do all package testing here where it won't affect pkg documenting

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

  expect_equal(matrix_sum(x), 4)

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

  #expect_equal(2 * 2, 4)
})
linley-sherin/netwerk documentation built on Dec. 21, 2021, 10:50 a.m.