@@ -709,22 +709,24 @@ end
709
709
end
710
710
711
711
@testset " Cached arrays" begin
712
- A = (1 : 300 ) * (1 : 1200 )'
713
- ch = ChunkedDiskArray ((1 : 3000 ) * (1 : 1200 )' , (128 , 128 ))
712
+ M = (1 : 300 ) * (1 : 1200 )'
713
+ A = cat (M, M, M, M; dims= 3 )
714
+ ch = ChunkedDiskArray (A, (128 , 128 , 2 ))
714
715
ca = DiskArrays. CachedDiskArray (ch; maxsize= 5 )
715
716
# Read the original
716
717
@test sum (ca) == sum (ca)
717
- # Read from the cache
718
- @test ca[:, :] == ch
719
718
length (ca. cache)
720
719
721
720
ca = DiskArrays. cache (ch; maxsize= 5 )
722
721
@test sum (ca) == sum (ca)
723
722
724
- @test ca[:, :] == ch[:, :]
725
- @test ca[:, 1 ] == ch[:, 1 ]
726
- @test ca[:, 2 ] == ch[:, 2 ]
727
- @test ca[:, 3 ] == ch[:, 3 ]
728
- @test ca[:, 200 ] == ch[:, 200 ]
729
- @test ca[200 , :] == ch[200 , :]
723
+ @test ca[:, :, 1 ] == A[:, :, 1 ]
724
+ @test ca[:, :, 2 ] == A[:, :, 2 ]
725
+ @test ca[:, :, 2 ] == A[:, :, 3 ]
726
+ @test ca[:, :, 2 ] == A[:, :, 4 ]
727
+ @test ca[:, 1 , 1 ] == ch[:, 1 , 1 ]
728
+ @test ca[:, 2 , 1 ] == ch[:, 2 , 1 ]
729
+ @test ca[:, 3 , 1 ] == ch[:, 3 , 1 ]
730
+ @test ca[:, 200 , 1 ] == ch[:, 200 , 1 ]
731
+ @test ca[200 , :, 1 ] == ch[200 , :, 1 ]
730
732
end
0 commit comments