tests/test_Rconcordance.R

source("helper/helper.R")

if (exists("as.Rconcordance", envir = asNamespace("tools"), inherits = FALSE)) {
  f <- get("as.Rconcordance", envir = asNamespace("tools"))
  expect_same <- makeCompareFun(f, backports:::as.Rconcordance.default)
   
  expect_same("<!-- concordance::Sample.Rmd:1 9 1 1 6 14 1 -->")
}

if (exists("matchConcordance", envir = asNamespace("tools"), inherits = FALSE)) {
  f = get("matchConcordance", envir = asNamespace("tools"))
  expect_same = makeCompareFun(f, backports:::matchConcordance)

  conc <- tools::as.Rconcordance("<!-- concordance::Sample.Rmd:1 9 1 1 6 14 1 -->")
  
  expect_same(20, conc)
}

Try the backports package in your browser

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

backports documentation built on June 24, 2024, 5:24 p.m.