tests/testthat/test_1-0-0_report_error.R

context("Report errors")

test_that("Report error", {
  expect_identical(format_hint(c("(A parenthesis.)",
                                 "Non-parenthesis",
                                 "(A question?)",
                                 "B question?")),
            c("(A parenthesis?)", "(Non-parenthesis?)", "(A question?)", "(B question?)"))
  
  expect_error(report_error(x,
                            "was not the case.",
                            "It must be.", 
                            advice = "It must be!",
                            hint = "Do you believe it?"),
               regexp = "(Do you believe it?)",
               fixed = TRUE)
})

Try the hutils package in your browser

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

hutils documentation built on April 13, 2022, 5:23 p.m.