tests/testthat/files/integration_test_cases/q3.R

test <- list(
  name = "q3",
  cases = list(
    ottr::TestCase$new(
      name = "q3-1",
      code = {
        testthat::expect_equal(length(y), 3)
      }
    ),
    ottr::TestCase$new(
      name = "q3-2",
      hidden = TRUE,
      points = 2,
      code = {
        testthat::expect_equal(y, c("hi there, a!", "hi there, b!", "hi there, c!"))
      },
      success_message = "y is correct",
      failure_message = "y is incorrect"
    )
  )
)

Try the ottr package in your browser

Any scripts or data that you put into this service are public.

ottr documentation built on May 29, 2024, 3:31 a.m.