Learn R Programming

testthat (version 0.2)

matches: Expectation: does string match regular expression?

Description

Expectation: does string match regular expression?

Usage

matches(regexp, ...)

Arguments

regexp
regular expression to test against
...
other arguments passed to grepl

Details

If the object to be tested has length greater than one, all elements of the vector must match the pattern in order to pass.

Examples

Run this code
expect_that("Testing is fun", matches("fun"))
expect_that("Testing is fun", matches("f.n"))

Run the code above in your browser using DataLab