tests/testthat/test-read_pak.R

testthat::test_that("We can read a PAK file.", {
  #pakf = system.file("extdata", "test.pak", package = "wal", mustWork = TRUE);
  pakf = file.path("~/data/PAK0.PAK");
  if(! file.exists(pakf)) {
    testthat::skip("Test PAK file available");
  }

  pak = read.pak(pakf);

  testthat::expect_false(is.null(pak$header));
  testthat::expect_false(is.null(pak$contents));
  testthat::expect_equal(nrow(pak$contents), 339L);
  testthat::expect_true(is.data.frame(pak$contents));

  # extract PAK file
  td = tempdir();
  pak.extract(pakf, outdir = td);
})

Try the wal package in your browser

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

wal documentation built on Jan. 17, 2021, 5:10 p.m.