From f27500cd60ac760f8d09c8fdb76f46ca37461b97 Mon Sep 17 00:00:00 2001 From: Felix Cremer Date: Thu, 17 Oct 2024 14:26:22 +0200 Subject: [PATCH] Add tests for cubesize and formatbytes --- test/Cubes/cubes.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/Cubes/cubes.jl b/test/Cubes/cubes.jl index 3abb53f7..7b436cdc 100644 --- a/test/Cubes/cubes.jl +++ b/test/Cubes/cubes.jl @@ -94,6 +94,16 @@ using DimensionalData @test a2.properties == Dict("att" => 5) @test YAXArrayBase.iscompressed(a) == false end + + @testset "cubesize" begin + @test Cubes.cubesize(a) == 160 + a32 = map(Float32, a) + @test Cubes.cubesize(a32) == 80 + + @test endswith(Cubes.formatbytes(160), "bytes") + @test endswith(Cubes.formatbytes(1205), "KB") + @test endswith(Cubes.formatbytes(1200000), "MB") + end #= @testset "Subsets" begin s = YAXArrays.Cubes.subsetcube(a, X = 1.5..3.5)