inst/tinytest/test_delete_trailing_whitespace.R

if (interactive()) {
  pkgload::load_all()
  library("tinytest")
}


template <- system.file("files", "blanks.txt", package = "fritools2")
input <- tempfile()
file.copy(template, input)
delete_trailing_whitespace(file_names = input)
result <- readLines(input)
template <- readLines(template)
expect_identical(
  nchar(result),
  as.integer(nchar(template) - c(2, 0, 0, 0))
)

Try the fritools2 package in your browser

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

fritools2 documentation built on July 9, 2023, 7:07 p.m.