Skip to content

Commit 29e029e

Browse files
committed
enclose all existing tests within a new test set
1 parent 9ee0854 commit 29e029e

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

test/no_invalidations.jl

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,42 +51,44 @@ function test_expr(f, supertype::Type)
5151
end
5252

5353
@testset "no invalidations test set" begin
54-
int_types = (Bool, Int8, UInt8, Int16, UInt16, Int, UInt, BigInt)
55-
@testset "construction of old int type from new type" begin
56-
broken = (Int8, UInt8, UInt16, Int, UInt)
57-
@testset "T: $T" for T int_types
58-
@test test_expr((n -> :(Base.$T(::$n) = $T(0))), Integer) broken=(T broken)
54+
@testset "new subtype of `Integer`" begin
55+
int_types = (Bool, Int8, UInt8, Int16, UInt16, Int, UInt, BigInt)
56+
@testset "construction of old int type from new type" begin
57+
broken = (Int8, UInt8, UInt16, Int, UInt)
58+
@testset "T: $T" for T int_types
59+
@test test_expr((n -> :(Base.$T(::$n) = $T(0))), Integer) broken=(T broken)
60+
end
5961
end
60-
end
61-
@testset "construction of new int type from old type" begin
62-
broken = ()
63-
@testset "T: $T" for T int_types
64-
@test test_expr((n -> :($n(::$T) = $n())), Integer) broken=(T broken)
62+
@testset "construction of new int type from old type" begin
63+
broken = ()
64+
@testset "T: $T" for T int_types
65+
@test test_expr((n -> :($n(::$T) = $n())), Integer) broken=(T broken)
66+
end
6567
end
66-
end
67-
@testset "arithmetic between old int types and new int type" begin
68-
ops = (:+, :*)
69-
broken = ()
70-
@testset "T: $T" for T int_types
71-
@testset "op: $op" for op ops
68+
@testset "arithmetic between old int types and new int type" begin
69+
ops = (:+, :*)
70+
broken = ()
71+
@testset "T: $T" for T int_types
72+
@testset "op: $op" for op ops
73+
@test (
74+
test_expr((n -> :(Base.$op(::$n, m::$T) = m)), Integer) &&
75+
test_expr((n -> :(Base.$op(m::$T, ::$n) = m)), Integer)
76+
) broken=((T, op) broken)
77+
end
78+
end
79+
end
80+
@testset "promotion between old int types and new int type" begin
81+
broken = (Bool, UInt8, Int)
82+
@testset "T: $T" for T int_types
7283
@test (
73-
test_expr((n -> :(Base.$op(::$n, m::$T) = m)), Integer) &&
74-
test_expr((n -> :(Base.$op(m::$T, ::$n) = m)), Integer)
75-
) broken=((T, op) broken)
84+
test_expr((n -> :(Base.promote_rule(::Type{$T}, ::Type{$n}) = $T)), Integer) &&
85+
test_expr((n -> :(Base.promote_rule(::Type{$n}, ::Type{$T}) = $T)), Integer)
86+
) broken=(T broken)
7687
end
7788
end
78-
end
79-
@testset "promotion between old int types and new int type" begin
80-
broken = (Bool, UInt8, Int)
81-
@testset "T: $T" for T int_types
82-
@test (
83-
test_expr((n -> :(Base.promote_rule(::Type{$T}, ::Type{$n}) = $T)), Integer) &&
84-
test_expr((n -> :(Base.promote_rule(::Type{$n}, ::Type{$T}) = $T)), Integer)
85-
) broken=(T broken)
89+
@testset "unary functions" begin
90+
@test test_expr((n -> :(Base.zero(::$n) = $n())), Integer) broken=true
91+
@test test_expr((n -> :(Base.one(::$n) = $n())), Integer) broken=true
8692
end
8793
end
88-
@testset "unary functions" begin
89-
@test test_expr((n -> :(Base.zero(::$n) = $n())), Integer) broken=true
90-
@test test_expr((n -> :(Base.one(::$n) = $n())), Integer) broken=true
91-
end
9294
end

0 commit comments

Comments
 (0)