context("test-either_of")
test_that("rx_either_of works", {
x <- rx() %>%
rx_either_of("cat", "dog") %>%
rx_space() %>%
rx_find("food")
string <- c("dog food", "cat food", "fish food")
# expect only two matches in above example
expect_equal(table(grepl(x, string))[["TRUE"]], 2)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.