From d446cfc5c782181086c85c679b5bc3113a4b2e04 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Thu, 7 Nov 2024 10:11:05 -0800 Subject: [PATCH] Add tests --- test/ecosystem.jl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/ecosystem.jl b/test/ecosystem.jl index af4593d85..b63651505 100644 --- a/test/ecosystem.jl +++ b/test/ecosystem.jl @@ -6,6 +6,7 @@ using ImageFiltering using ImageTransformations using ArrayInterface using StatsBase +using DiskArrays using DimensionalData.Lookups @@ -84,3 +85,20 @@ end @test mean(da, weights([0.3,0.3,0.4]); dims=Y) == mean(parent(da), weights([0.3,0.3,0.4]); dims=2) @test sum(da, weights([0.3,0.3,0.4]); dims=Y) == sum(parent(da), weights([0.3,0.3,0.4]); dims=2) end + +@testset "DiskArrays" begin + raw_data = rand(100, 100) + chunked_data = DiskArrays.TestTypes.ChunkedDiskArray(raw_data, (10, 10)) + da = DimArray(chunked_data, (X, Y)) + + @testset "cache" begin + @test parent(da) isa DiskArrays.TestTypes.ChunkedDiskArray + @test DiskArrays.cache(da) isa DimArray + @test parent(DiskArrays.cache(da)) isa DiskArrays.CachedDiskArray + @test all(==, da, DiskArrays.cache(da)) + end + @testset "chunks" begin + @test DiskArrays.haschunks(da) + @test DiskArrays.eachchunk(da) == DiskArrays.eachchunk(raw_data) + end +end