tests/testthat/test_loadRevHistory.R

library(Revticulate)
library(testthat)

test_that(
  "Testing loadRevHistory()",
  {
    clearRev()

    file <- tempfile()

    cat(c(1:10), sep = "\n", file = file)

    loadRevHistory(file)

    expect_true(all(getRevHistory() == c("#START", 1:10)))


    clearRev()
  }
)

Try the Revticulate package in your browser

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

Revticulate documentation built on March 18, 2022, 6:47 p.m.