Skip to content

Commit 121f5ff

Browse files
committed
Add tests and make the sizes a bit more diverse
1 parent 5abd171 commit 121f5ff

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

test/testsuite/construction.jl

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,26 @@ function value_constructor(AT)
164164
@test all(x-> x == 2f0, Array(x1))
165165
@test all(x-> x == Int32(77), Array(x2))
166166

167-
x = Matrix{T}(I, 2, 2)
167+
x = Matrix{T}(I, 4, 2)
168168

169-
x1 = AT{T, 2}(I, 2, 2)
170-
x2 = AT{T}(I, (2, 2))
171-
x3 = AT{T, 2}(I, (2, 2))
169+
x1 = AT{T, 2}(I, 4, 2)
170+
x2 = AT{T}(I, (4, 2))
171+
x3 = AT{T, 2}(I, (4, 2))
172172

173173
@test Array(x1) x
174174
@test Array(x2) x
175175
@test Array(x3) x
176+
177+
x = Matrix(T(3) * I, 2, 4)
178+
x1 = AT(T(3) * I, 2, 4)
179+
@test eltype(x1) == T
180+
@test Array(x1) x
181+
182+
x = fill(T(3), (2, 4))
183+
x1 = fill(AT{T}, T(3), (2, 4))
184+
copyto!(x, 2I)
185+
copyto!(x1, 2I)
186+
@test Array(x1) x
176187
end
177188
end
178189
end

0 commit comments

Comments
 (0)