tests/testthat/testreadwrite.R

context("readwrite")

test_that("Writing and reading works",{
  x <- data.frame(a=1, b=2)
  y <- x
  y[1,1] <- 100

  patch <- diff_data(x,y)

  patch_file <- tempfile()

  write_diff(patch, patch_file)

  patch2 <- read_diff(patch_file)
  expect_equal(patch2$to_csv(), patch$to_csv())
})

Try the daff package in your browser

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

daff documentation built on Oct. 9, 2023, 1:06 a.m.