We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95833da commit 7055806Copy full SHA for 7055806
test/testsuite/construction.jl
@@ -100,12 +100,27 @@ end
100
101
@testsuite "construct/convenience" AT->begin
102
for T in supported_eltypes()
103
- @test compare((a,b)->fill!(a, b), AT, rand(T, 3), rand(T))
104
-
105
- @test compare(a->zero(a), AT, rand(T, 2))
106
- @test compare(a->zero(a), AT, rand(T, 2, 2))
107
- @test compare(a->zero(a), AT, rand(T, 2, 2, 2))
108
- @test compare(a->one(a), AT, rand(T, 2, 2))
+ A = AT(rand(T, 3))
+ b = rand(T)
+ fill!(A, b)
+ @test A isa AT{T,1}
+ @test Array(A) == fill(b, 3)
+
109
+ A = zero(AT(rand(T, 2)))
110
111
+ @test Array(A) == zero(rand(T, 2))
112
113
+ A = zero(AT(rand(T, 2, 2)))
114
+ @test A isa AT{T,2}
115
+ @test Array(A) == zero(rand(T, 2, 2))
116
117
+ A = zero(AT(rand(T, 2, 2, 2)))
118
+ @test A isa AT{T,3}
119
+ @test Array(A) == zero(rand(T, 2, 2, 2))
120
121
+ A = one(AT(rand(T, 2, 2)))
122
123
+ @test Array(A) == one(rand(T, 2, 2))
124
end
125
126
0 commit comments