tests/testthat/test-not.R

context("test-rx_not")

test_that("not rule works", {

  # expect minimal output
  expect_equal(rx_not(value = "") %>% as.character(), "(?!)")

  # expect that u is not followed by q
  expect_false(grepl(rx_find(value = "q") %>% rx_not("u"), "qu", perl = TRUE))
  expect_true(grepl(rx_find(value = "q") %>% rx_not("u"), "qa", 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.