context("Checking cheat") test_that("cheat returns as expected",{ m <- structure(list(Name = c("Lookahead", "Lookbehind", "Negative Lookahead", "Negative Lookbehind", "Non-Capturing Group", "Exception", "Dot", "Case Insensitive", "Digit", "Non-Digit", "Word", "Non-Word", "Whitespace", "Non-Whitespace", "Word Boundary", "Non-Word Boundary", "0-1 (Greedy)", "0-1 (Lazy)", ">= 0 (Greedy)", ">= 0 (Lazy)", ">= 1 (Greedy)", ">= 1 (Lazy)", "Exactly N", "Min-Max", "> N" ), Regex = c("(?=foo)", "(?<=foo)", "(?!foo)", "(?= 0 (Greedy) x* Match 0 or more times greedy ", "20 >= 0 (Lazy) x*? Match 0 or more times lazy ", "21 >= 1 (Greedy) x+ Match 1 or more times greedy ", "22 >= 1 (Lazy) x+? Match 1 or more times lazy ", "23 Exactly N x{4} Match N times ", "24 Min-Max x{4,8} Match min-max times ", "25 > N x{9,} Match N or more times " ) expect_equivalent(capture.output(cheat()), out2) })