tests/testthat/test-longmcq.R

test_that("no answer", {
  expect_error(longmcq(c("A", "B")))
})

test_that("apostrophe works", {
  html <- longmcq(c(answer="will", "won't", "might"))
  expect_equal(grep("<span>won&apos;t</span>", html, fixed = TRUE), 1L)
})

Try the webexercises package in your browser

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

webexercises documentation built on May 31, 2023, 8:16 p.m.