library(testthat)
library(multiple)
test_that("Double values are correct", {
skip_on_cran()
x <- 1:2
# 2 x 2 should be 4
expect_equal(double(x), c(2, 4))
# The result should be a number (type = 'double')
expect_type(double(x), "double")
# Error management
expect_error(double("a"))
})
test_that("Double values are equal", {
skip_on_cran()
x <- 1:2
# double multiple(times = 2)$y should give the same result
expect_equal(double(x), multiple(x, times = 2)$y)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.