Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Nov 7, 2024
1 parent 9861a68 commit d446cfc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/ecosystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using ImageFiltering
using ImageTransformations
using ArrayInterface
using StatsBase
using DiskArrays

using DimensionalData.Lookups

Expand Down Expand Up @@ -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

0 comments on commit d446cfc

Please sign in to comment.