tests/testthat/test_washer.R

library(furniture)
library(testthat)

test_that("washer produces correct output vectors", {
  expect_equal(washer(c(1,2,3,4), 1), c(NA,2,3,4))
  expect_equal(washer(c(1,2,3,4), 1, value=0), c(0,2,3,4))
  expect_equal(washer(as.character(c(1,2,3,4)), 1, value=0), as.character(c(0,2,3,4)))
})

Try the furniture package in your browser

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

furniture documentation built on Sept. 8, 2023, 5:55 p.m.