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))

})
VerbalExpressions/RVerbalExpressions documentation built on March 27, 2024, 8:20 a.m.