packrat/lib/x86_64-pc-linux-gnu/3.2.3/evaluate/tests/testthat/test-parse.r

context("Parsing")

test_that("{ not removed", {

  f <- function() {
    for (i in 1:3) {
      plot(rnorm(100))
      lines(rnorm(100))
    }
  }

  expect_that(nrow(parse_all(f)), equals(1))

})

# test some multibyte characters when the locale is UTF8 based
if (identical(Sys.getlocale("LC_CTYPE"), "en_US.UTF-8")) {

  test_that("double quotes in Chinese characters not destroyed", {
    expect_identical(parse_all(c('1+1', '"你好"'))[2, 1], '"你好"')
  })

  test_that("multibyte characters are parsed correct", {
    code <- c("ϱ <- 1# g / ml", "äöüßÄÖÜπ <- 7 + 3# nonsense")
    expect_identical(parse_all(code)$src, append_break(code))
  })

}
etsakl/DasyMapR documentation built on May 16, 2019, 9:07 a.m.