tests/testthat/test-pformat.R

library(pformat)

context("Basic parsing")

test_that("Double braces are correctly interpreted", {
  expect_equal(pformat("{{"), "{")
  expect_equal(pformat("}}"), "}")
})

test_that("Unmatching braces trigger error", {
  expect_error(pformat("{"))
  expect_error(pformat("}"))
  expect_error(pformat("{{{"))
  expect_error(pformat("}}}"))
})
lurodrigo/pformat documentation built on May 21, 2019, 8:58 a.m.