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)
})
HughParsonage/hutils documentation built on Feb. 12, 2023, 8:26 a.m.