@@ -16,6 +16,22 @@ using FixedSizeArrays
16
16
@test similar (FixedSizeVector{Int}, (2 ,)) isa FixedSizeVector{Int}
17
17
@test similar (FixedSizeArray{Int}, (2 ,)) isa FixedSizeVector{Int}
18
18
@test FixedSizeArray {Int} (undef, 2 ) isa FixedSizeVector{Int}
19
+ for T ∈ (FixedSizeArray, FixedSizeVector)
20
+ a = 1 : 3
21
+ @test convert (T, a) isa FixedSizeVector{Int}
22
+ @test convert (T, a) == a
23
+ @test convert (T, convert (T, a)) isa FixedSizeVector{Int}
24
+ @test convert (T, convert (T, a)) == a
25
+ end
26
+ for T ∈ (FixedSizeArray{Int}, FixedSizeVector{Int})
27
+ for S ∈ (Int, Float64)
28
+ a = map (S, 1 : 3 )
29
+ @test convert (T, a) isa FixedSizeVector{Int}
30
+ @test convert (T, a) == a
31
+ @test convert (T, convert (T, a)) isa FixedSizeVector{Int}
32
+ @test convert (T, convert (T, a)) == a
33
+ end
34
+ end
19
35
end
20
36
21
37
@testset " FixedSizeMatrix" begin
@@ -32,6 +48,22 @@ using FixedSizeArrays
32
48
@test similar (FixedSizeMatrix{Int}, (2 , 3 )) isa FixedSizeMatrix{Int}
33
49
@test similar (FixedSizeArray{Int}, (2 , 3 )) isa FixedSizeMatrix{Int}
34
50
@test FixedSizeArray {Int} (undef, 2 , 3 ) isa FixedSizeMatrix{Int}
51
+ for T ∈ (FixedSizeArray, FixedSizeMatrix)
52
+ a = reshape (1 : 9 , (3 , 3 ))
53
+ @test convert (T, a) isa FixedSizeMatrix{Int}
54
+ @test convert (T, a) == a
55
+ @test convert (T, convert (T, a)) isa FixedSizeMatrix{Int}
56
+ @test convert (T, convert (T, a)) == a
57
+ end
58
+ for T ∈ (FixedSizeArray{Int}, FixedSizeMatrix{Int})
59
+ for S ∈ (Int, Float64)
60
+ a = map (S, reshape (1 : 9 , (3 , 3 )))
61
+ @test convert (T, a) isa FixedSizeMatrix{Int}
62
+ @test convert (T, a) == a
63
+ @test convert (T, convert (T, a)) isa FixedSizeMatrix{Int}
64
+ @test convert (T, convert (T, a)) == a
65
+ end
66
+ end
35
67
end
36
68
37
69
@testset " broadcasting" begin
0 commit comments