Skip to content

Commit

Permalink
test map
Browse files Browse the repository at this point in the history
  • Loading branch information
nsajko committed Apr 22, 2024
1 parent 47d39ea commit ef789bf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ using FixedSizeArrays
end
end

@testset "`map`" begin
for dim_count 0:3
size = ntuple(Returns(3), dim_count)
a = FixedSizeArray{Int, dim_count}(undef, size)
for v (3, 3.1, nothing)
mapped = map(Returns(v), a)
@test all(==(v), mapped)
@test mapped isa FixedSizeArray{typeof(v), dim_count}
end
end
end

@testset "broadcasting" begin
v3 = FixedSizeArray{Int}(undef, 3)
@test v3 isa FixedSizeVector{Int}
Expand Down

0 comments on commit ef789bf

Please sign in to comment.