tests/testthat/test_sum_product.r

context("sum_product")

test_that("Returns expected value.", {
  ss <- sum_product(1:5,6:10)
  expect_equal(ss, 130)
})

test_that("Error messages are working properly",{
  testthat::expect_error(sum_product(1:5,6:9)
                         , "Length of x and y must be the same.")


})
ArithmeticR/TOmisc documentation built on May 14, 2019, 12:43 p.m.