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 Aug. 20, 2018, 9:04 a.m.