tests/testthat/test-misc.R

context("exactly")

test_that(
  "exactly wraps in start and end",
  {
    expected <- as.regex("^foo$")
    actual <- exactly("foo")
    expect_equal(actual, expected)
  }
)

context("literal")

test_that(
  "literal wraps in literal tokens",
  {
    expected <- as.regex("\\Qfoo\\E")
    actual <- literal("foo")
    expect_equal(actual, expected)
  }
)

Try the rebus.base package in your browser

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

rebus.base documentation built on May 2, 2019, 5:14 a.m.