tests/testthat/test-export-modified.R

test_that("exporting unnamed lists works", {

  x <- list()
  autograph(for(i in 1:10) x[[i]] <- i)
  expect_identical(x, as.list(1:10))

  x <- list()
  x$y <- list()
  autograph(for(i in 1:10) x$y[[i]] <- i)
  expect_identical(x$y, as.list(1:10))

  x <- list()
  x$y <- list()
  x$y$z <- list()
  autograph(for(i in 1:10) x$y$z[[i]] <- i)
  expect_identical(x$y$z, as.list(1:10))

})

Try the tfautograph package in your browser

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

tfautograph documentation built on Sept. 18, 2021, 1:07 a.m.