Skip to content

Commit

Permalink
Add tests for various index types
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Mar 29, 2023
1 parent 802a613 commit 738def2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,15 @@ end
@test FillArrays.getindex_value(v) == FillArrays.unique_value(v) == 2.0
@test convert(Fill, v) Fill(2.0,2)
@test view(a,1) Fill(2.0)
@test view(a,1,1) Fill(2.0)
@test view(a, :) === a
@test view(a, CartesianIndices(a)) === a
vv = view(a, CartesianIndices(a), :, 1)
@test ndims(vv) == 2
@test vv isa Fill && FillArrays.getindex_value(vv) == 2.0
vv = view(a, CartesianIndices(a), :, 1:1)
@test ndims(vv) == 3
@test vv isa Fill && FillArrays.getindex_value(vv) == 2.0
end

@testset "view with bool" begin
Expand Down

0 comments on commit 738def2

Please sign in to comment.