expect_match | R Documentation |
Results in TRUE
only when all elements of current match the regular
expression in pattern
. Matching is done by grepl
.
expect_match(current, pattern, info = NA_character_, ...)
current |
|
pattern |
|
info |
|
... |
passed to |
Other test-functions:
expect_equal_to_reference()
,
expect_equal()
,
expect_length()
,
ignore()
expect_match("hello world", "world") # TRUE expect_match("hello world", "^world$") # FALSE expect_match("HelLO woRlD", "world", ignore.case=TRUE) # TRUE expect_match(c("apple","banana"), "a") # TRUE expect_match(c("apple","banana"), "b") # FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.