tests/testthat/test-regex.R

test_that("Proper regular expressions are returned", {
  expect_equal(
    as.character(get_tplyr_regex('format_string')),
    "(a(\\+\\d+)?|(\\S+)A(\\+\\d+)?|(\\S+)X+|x+)(\\.([A|a](\\+\\d+)?|[X|x]+)?)?"
  )

  expect_equal(
    as.character(get_tplyr_regex('format_group')),
    "[^\\s\\d]*\\s*(\\-?\\d+(\\.\\d+)?)\\S*"
  )
})

Try the Tplyr package in your browser

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

Tplyr documentation built on May 29, 2024, 10:37 a.m.