Skip to content

Commit 72db1f1

Browse files
authored
Add tests for show for Chunk types (#269)
1 parent 716f509 commit 72db1f1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/runtests.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,22 @@ end
10561056
@test getindex_count(A) == 0
10571057
end
10581058

1059+
@testset "Show Gridchunks" begin
1060+
chunks = DiskArrays.GridChunks((10,10,10), (2,2,3))
1061+
sp = sprint(show, MIME("text/plain"), chunks)
1062+
@test occursin("5×5×4", sp)
1063+
@test occursin("(1:2", sp)
1064+
@test occursin("10:10)", sp)
1065+
end
1066+
1067+
@testset "Show RegularChunks" begin
1068+
regularchunks = DiskArrays.RegularChunks(10,0,20)
1069+
sr = sprint(show, MIME("text/plain"), regularchunks)
1070+
@test occursin("2-element", sr)
1071+
@test occursin("RegularChunks", sr)
1072+
@test occursin("1:10", sr)
1073+
end
1074+
10591075
@testset "Map over indices correctly" begin
10601076
# This is a regression test for issue #144
10611077
# `map` should always work over the correct indices,

0 commit comments

Comments
 (0)