tests/testthat/test-special-dot.R

test_that("`.` is special in cherry picking mode", {
  dir.create(tmp <- tempfile("zip-test-dot-"))
  on.exit(unlink(tmp, recursive = TRUE), add = TRUE)

  old <- getwd()
  on.exit(setwd(old), add = TRUE)
  setwd(tmp)

  dir.create("xxx")
  writeLines("bar", file.path("xxx", "bar"))
  writeLines("foo", file.path("xxx", "foo"))
  setwd("xxx")

  zip::zip("../out.zip", ".", mode="cherry-pick", include_directories = FALSE)

  expect_equal(sort(zip_list("../out.zip")$file), sort(c("bar", "foo")))
})

Try the zip package in your browser

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

zip documentation built on April 17, 2023, 5:08 p.m.