Skip to content

Commit

Permalink
added some more tests to arrays.jl (#935)
Browse files Browse the repository at this point in the history
Add tests for different sizes of arrays
  • Loading branch information
krishna-vasudev authored Jan 14, 2021
1 parent 4aa0954 commit 810480a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/arrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ using Images, IndirectArrays, Test
for (a,t) in zip(A, target)
@test a === t
end

intensity1 = [0.1 0.3 0.6; 0.2 0.4 0.1]
labels1 = IndirectArray([1 2 3; 2 1 3], [RGB(1,0,0), RGB(0,0,1),RGB(0,1,0)])
A1 = ColorizedArray(intensity1, labels1)
target1 = intensity1 .* labels1
@test eltype(A1) == RGB{Float64}
@test size(A1) == (2,3)
@test axes(A1) == (1:2, 1:3)
for i = 1:6
@test A1[i] === target1[i]
end
for j = 1:3, i = 1:2
@test A1[i,j] === target1[i,j]
end
for (a,t) in zip(A1, target1)
@test a === t
end
end

nothing

0 comments on commit 810480a

Please # to comment.