|
128 | 128 | @test convert(SArray{(1,),Float64,1,Tuple{Float64}}, ma_int) === sa_float
|
129 | 129 | @test_inferred convert(SArray{(1,),Float64,1,Tuple{Float64}}, ma_int)
|
130 | 130 | end
|
131 |
| -
|
| 131 | + =# |
132 | 132 | @testset "AbstractArray conversion" begin
|
133 |
| - sa = SArray{(2,2)}((3,4,5,6)) |
134 |
| - ma = MArray{(2,2)}((3,4,5,6)) |
| 133 | + sa = SArray{Tuple{2,2}, Int}((3, 4, 5, 6)) |
| 134 | + ma = MArray{Tuple{2,2}, Int}((3, 4, 5, 6)) |
135 | 135 | a = [3 5; 4 6]
|
136 | 136 |
|
137 |
| - @test convert(SArray{(2,2)}, a) === sa |
138 |
| - @test_inferred convert(SArray{(2,2)}, a) |
139 |
| - @test convert(SArray{(2,2),Int}, a) === sa |
140 |
| - @test_inferred convert(SArray{(2,2),Int}, a) |
141 |
| - @test convert(SArray{(2,2),Int,2}, a) === sa |
142 |
| - @test_inferred convert(SArray{(2,2),Int,2}, a) |
143 |
| - @test convert(SArray{(2,2),Int,2,NTuple{4,Int}}, a) === sa |
144 |
| - @test_inferred convert(SArray{(2,2),Int,2,NTuple{4,Int}}, a) |
145 |
| -
|
146 |
| - @test convert(MArray{(2,2)}, a) == ma |
147 |
| - @test_inferred convert(MArray{(2,2)}, a) |
148 |
| - @test convert(MArray{(2,2),Int}, a) == ma |
149 |
| - @test_inferred convert(MArray{(2,2),Int}, a) |
150 |
| - @test convert(MArray{(2,2),Int,2}, a) == ma |
151 |
| - @test_inferred convert(MArray{(2,2),Int,2}, a) |
152 |
| - @test convert(MArray{(2,2),Int,2,NTuple{4,Int}}, a) == ma |
153 |
| - @test_inferred convert(MArray{(2,2),Int,2,NTuple{4,Int}}, a) |
154 |
| -
|
155 |
| - @test convert(Array, sa) == a |
156 |
| - @test_inferred convert(Array, sa) |
157 |
| - @test convert(Array{Int}, sa) == a |
158 |
| - @test_inferred convert(Array{Int}, sa) |
159 |
| - @test convert(Array{Int,2}, sa) == a |
160 |
| - @test_inferred convert(Array{Int,2}, sa) |
161 |
| -
|
162 |
| - @test convert(Array, ma) == a |
163 |
| - @test_inferred convert(Array, ma) |
164 |
| - @test convert(Array{Int}, ma) == a |
165 |
| - @test_inferred convert(Array{Int}, ma) |
166 |
| - @test convert(Array{Int,2}, ma) == a |
167 |
| - @test_inferred convert(Array{Int,2}, ma) |
168 |
| - end =# |
| 137 | + @test @inferred(convert(SArray{Tuple{2,2}}, a)) === sa |
| 138 | + @test @inferred(convert(SArray{Tuple{2,2},Int}, a)) === sa |
| 139 | + @test @inferred(convert(SArray{Tuple{2,2},Int,2}, a)) === sa |
| 140 | + @test @inferred(convert(SArray{Tuple{2,2},Int,2,4}, a)) === sa |
| 141 | + |
| 142 | + @test @inferred(convert(MArray{Tuple{2,2}}, a)) == ma |
| 143 | + @test @inferred(convert(MArray{Tuple{2,2},Int}, a)) == ma |
| 144 | + @test @inferred(convert(MArray{Tuple{2,2},Int,2}, a)) == ma |
| 145 | + @test @inferred(convert(MArray{Tuple{2,2},Int,2,4}, a)) == ma |
| 146 | + |
| 147 | + @test @inferred(convert(Array, sa)) == a |
| 148 | + @test @inferred(convert(Array{Int}, sa)) == a |
| 149 | + @test @inferred(convert(Array{Int,2}, sa)) == a |
| 150 | + |
| 151 | + @test @inferred(convert(Array, ma)) == a |
| 152 | + @test @inferred(convert(Array{Int}, ma)) == a |
| 153 | + @test @inferred(convert(Array{Int,2}, ma)) == a |
| 154 | + end |
169 | 155 | @test_throws Exception Length{2.5}()
|
170 | 156 | @test Length(2) == Length{2}()
|
171 | 157 | @test Tuple{2, 3, 5} != Size{(2, 3, 4)}
|
|
0 commit comments