Skip to content

Commit bc0095e

Browse files
committed
Move over tests from CuArrays.
1 parent cdbe16d commit bc0095e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/testsuite/construction.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,60 @@ function test_construction(Typ)
88
end
99

1010
function constructors(Typ)
11-
@testset "similar + constructor" begin
11+
@testset "constructors + similar" begin
1212
for T in supported_eltypes()
1313
B = Typ{T}(10)
14+
@test B isa Typ{T,1}
1415
@test size(B) == (10,)
1516
@test eltype(B) == T
1617

1718
B = Typ{T}(10, 10)
19+
@test B isa Typ{T,2}
1820
@test size(B) == (10, 10)
1921
@test eltype(B) == T
2022

2123
B = Typ{T}((10, 10))
24+
@test B isa Typ{T,2}
2225
@test size(B) == (10, 10)
2326
@test eltype(B) == T
2427

2528
B = similar(B, Int32, (11, 15))
29+
@test B isa Typ{Int32,2}
2630
@test size(B) == (11, 15)
2731
@test eltype(B) == Int32
2832

2933
B = similar(B, T)
34+
@test B isa Typ{T,2}
3035
@test size(B) == (11, 15)
3136
@test eltype(B) == T
3237

3338
B = similar(B, (5,))
39+
@test B isa Typ{T,1}
3440
@test size(B) == (5,)
3541
@test eltype(B) == T
3642

3743
B = similar(B, 7)
44+
@test B isa Typ{T,1}
3845
@test size(B) == (7,)
3946
@test eltype(B) == T
4047

41-
4248
B = similar(Typ{Int32}, (11, 15))
49+
@test B isa Typ{Int32,2}
4350
@test size(B) == (11, 15)
4451
@test eltype(B) == Int32
4552

4653
B = similar(Typ{Int32, 2}, T, (11, 15))
54+
@test B isa Typ{T,2}
4755
@test size(B) == (11, 15)
4856
@test eltype(B) == T
4957

5058
B = similar(Typ{T}, (5,))
59+
@test B isa Typ{T,1}
5160
@test size(B) == (5,)
5261
@test eltype(B) == T
5362

5463
B = similar(Typ{T}, 7)
64+
@test B isa Typ{T,1}
5565
@test size(B) == (7,)
5666
@test eltype(B) == T
5767
end

0 commit comments

Comments
 (0)