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.")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.