tests/testthat/test-get_chunk_ids.r

context("test-get_chunk_ids")

setup({
  #setup_disk.frame(workers = 1)
  df = as.disk.frame(disk.frame:::gen_datatable_synthetic(1e5+11), file.path(tempdir(), "tmp_del_delete"), overwrite=T)
})

test_that("get_chunk_ids", {
  df = disk.frame(file.path(tempdir(), "tmp_del_delete"))
  
  gci = get_chunk_ids(df)
  expect_type(get_chunk_ids(df), "character")

  gcis = get_chunk_ids(df, strip_extension = F)
  expect_true("1.fst" %in% gcis)
})

teardown({
  fs::dir_delete(file.path(tempdir(), "tmp_del_delete"))
})
xiaodaigh/disk.frame documentation built on Feb. 3, 2023, 10:04 p.m.