tests/testthat/test_epmc_ftxt.r

context("testing epmc_ftxt")

test_that("epmc_ftxt returns", {
  skip_on_cran()
  a <- epmc_ftxt("PMC3257301")
  b <- epmc_ftxt("PMC3639880")

  #correct class metadata
  expect_is(a, "xml_document")
  expect_is(b, "xml_document")

  # fails correctly
  expect_error(epmc_ftxt("2PMC3448176"))
  expect_error(epmc_ftxt("PMC3476"))
  expect_error(epmc_ftxt("3476"),
    "Please provide a PMCID, i.e. ids starting with 'PMC'"
    )
})

Try the europepmc package in your browser

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

europepmc documentation built on Sept. 21, 2023, 1:07 a.m.