| matches {testthat} | R Documentation |
If the object to be tested has length greater than one, all elements of the vector must match the pattern in order to pass.
matches(regexp, all = TRUE)
expect_match(object, regexp, all = TRUE, info = NULL,
label = NULL)
regexp |
regular expression to test against |
all |
should all elements of actual value match
|
object |
object to test |
info |
extra information to be included in the message (useful when writing tests in loops). |
label |
object label. When |
str_detect for the function that
powers the string matching
Other expectations: equals,
expect_equal,
expect_equivalent,
expect_error, expect_false,
expect_identical, expect_is,
expect_message,
expect_output, expect_true,
expect_warning,
gives_warning, is_a,
is_equivalent_to, is_false,
is_identical_to, is_true,
prints_text, shows_message,
takes_less_than, throws_error
expect_that("Testing is fun", matches("fun"))
expect_that("Testing is fun", matches("f.n"))
expect_match("Testing is fun", "f.n")