tests/testthat/test-avoid.R

context("test-rx_avoid")

test_that("negative lookarounds work", {

  # expect match
  expect_false(grepl(rx() %>% rx_avoid_prefix("USD") %>% rx_digit(), "USD1", perl = TRUE))
  expect_false(grepl(rx() %>% rx_digit() %>% rx_multiple(max = 3) %>% rx_avoid_suffix(" km"), "100 km", perl = TRUE))

})

Try the RVerbalExpressions package in your browser

Any scripts or data that you put into this service are public.

RVerbalExpressions documentation built on Nov. 6, 2019, 5:08 p.m.