chunktest::init()
plus <- function(x, y) rep(1,length(x)) + rep(1, length(y))
```{testthat test1} test_that("one plus one is two", { expect_equal(1 + 1, 2) })
test_that("you can skip tests if needed", { skip("This tests hasn't been written yet") })
test_that("some tests have warnings", { expect_equal(log(-1), NaN) })
test_that("some more successes just to pad things out", { expect_true(TRUE) expect_false(FALSE) })
```{testthat} test_that("one plus one is two", { expect_equal(plus(1, 1), 2) }) test_that("two plus two is four", { expect_equal(plus(1:2, 1:2), c(2,4)) expect_equal(plus(2:3, 2:3), c(4,6)) expect_equal(plus(4, 4), 8) expect_equal(plus(5, 5), 10) }) test_that("two plus two is four", { expect_equal(plus(2, 2), 4) }) test_that("two plus two is four", { expect_equal(plus(2, 2), 4) }) test_that("two plus two is four", { expect_equal(plus(2, 2), 4) }) test_that("two plus two is four", { expect_equal(plus(2, 2), 4) })
ls() cli::rule(center="test", col="red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.