library(pizzarr) sample_dir <- tools::R_user_dir("pizzarr") clean <- !dir.exists(sample_dir) test_that("demo data", { skip_if_not_installed("crul") demo_data <- pizzarr_sample() expect_true(all(dir.exists(demo_data))) expect_true(all(grepl("zarr$", demo_data))) expect_error(pizzarr_sample("borked"), "Dataset not found") expect_true(grepl("bcsd_v2.zarr", pizzarr_sample("bcsd"))) expect_true(grepl("bcsd_v3.zarr", pizzarr_sample("bcsd_v3"))) }) test_that("create_zarray_meta does not throw error when simple dtype is valid", { res <- create_zarray_meta(dtype = Dtype$new("|u1"), order = "C", fill_value = 0, dimension_separator = ".") expect_equal(class(res$dtype)[[1]], "scalar") expect_equal(as.character(res$dtype), "|u1") }) test_that("create_zarray_meta throws error when simple dtype byteorder is invalid", { f <- function() create_zarray_meta(dtype = Dtype$new(":u1"), order = "C", fill_value = 0, dimension_separator = ".") expect_error(f()) }) test_that("create_zarray_meta throws error when simple dtype basic type is invalid", { f <- function() create_zarray_meta(dtype = Dtype$new("