library(pizzarr) # ============================================================================= # Gap 8: v2_config_to_v3_codec / build_v3_codec_pipeline # ============================================================================= test_that("v2_config_to_v3_codec converts gzip", { v2_config <- list(id = jsonlite::unbox("gzip"), level = jsonlite::unbox(5L)) result <- v2_config_to_v3_codec(v2_config) expect_equal(as.character(result$name), "gzip") expect_equal(as.integer(result$configuration$level), 5L) }) test_that("v2_config_to_v3_codec converts zstd", { v2_config <- list(id = jsonlite::unbox("zstd"), level = jsonlite::unbox(3L)) result <- v2_config_to_v3_codec(v2_config) expect_equal(as.character(result$name), "zstd") expect_equal(as.integer(result$configuration$level), 3L) # zstd should get checksum added expect_false(is.null(result$configuration$checksum)) }) test_that("v2_config_to_v3_codec converts blosc with shuffle int->string", { v2_config <- list( id = jsonlite::unbox("blosc"), cname = jsonlite::unbox("lz4"), clevel = jsonlite::unbox(5L), shuffle = jsonlite::unbox(1L) ) result <- v2_config_to_v3_codec(v2_config, dtype = "