Skip to content

Commit 9e9ea02

Browse files
authored
Test arithmetic_closure against concrete types (#1237)
1 parent 5913f33 commit 9e9ea02

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/arraymath.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ end
77
Random.rand(rng::AbstractRNG, d::Random.SamplerTrivial{TestDie}) = rand(rng, 1:d[].nsides)
88
Base.eltype(::Type{TestDie}) = Int
99

10+
const AbstractFloatSubtypes = [Float16, Float32, Float64, BigFloat]
11+
const UnsignedSubtypes = [UInt8, UInt16, UInt32, UInt64, UInt128]
12+
const SignedSubtypes = [Int8, Int16, Int32, Int64, Int128, BigInt]
13+
1014
@testset "Array math" begin
1115
@testset "zeros() and ones()" begin
1216
@test @inferred(zeros(SVector{3,Float64})) === @SVector [0.0, 0.0, 0.0]
@@ -336,13 +340,12 @@ Base.eltype(::Type{TestDie}) = Int
336340
end
337341
end
338342

339-
@testset "arithmetic_closure" for T0 in [subtypes(Unsigned);
340-
subtypes(Signed);
341-
subtypes(AbstractFloat);
343+
@testset "arithmetic_closure" for T0 in [UnsignedSubtypes;
344+
SignedSubtypes;
345+
AbstractFloatSubtypes;
342346
Bool;
343347
Complex{Int};
344348
Complex{Float64};
345-
BigInt
346349
]
347350
T = @inferred arithmetic_closure(T0)
348351
@test arithmetic_closure(T) == T

0 commit comments

Comments
 (0)