Skip to content

Commit 9e0b0ba

Browse files
committed
further cleanup of tests
1 parent 40b2ea7 commit 9e0b0ba

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

stdlib/Statistics/test/runtests.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,20 @@ end
8787
@test isequal(mean([missing 1.0; 2.0 3.0], dims=1), [missing 2.0])
8888
@test mean(skipmissing([1, missing, 2])) === 1.5
8989
@test isequal(mean(Complex{Float64}[]), NaN+NaN*im)
90-
@test isequal(mean(skipmissing(Complex{Float64}[])), NaN+NaN*im)
9190
@test mean(Complex{Float64}[]) isa Complex{Float64}
91+
@test isequal(mean(skipmissing(Complex{Float64}[])), NaN+NaN*im)
9292
@test mean(skipmissing(Complex{Float64}[])) isa Complex{Float64}
9393
@test isequal(mean(abs, Complex{Float64}[]), NaN)
94-
@test isequal(mean(abs, skipmissing(Complex{Float64}[])), NaN)
9594
@test mean(abs, Complex{Float64}[]) isa Float64
95+
@test isequal(mean(abs, skipmissing(Complex{Float64}[])), NaN)
9696
@test mean(abs, skipmissing(Complex{Float64}[])) isa Float64
97-
@test_throws MethodError mean([])
98-
@test_throws MethodError mean(skipmissing([]))
99-
@test_throws MethodError mean((1 for i in 2:1))
97+
@test isequal(mean(Int[]), NaN)
10098
@test mean(Int[]) isa Float64
99+
@test isequal(mean(skipmissing(Int[])), NaN)
101100
@test mean(skipmissing(Int[])) isa Float64
101+
@test_throws MethodError mean([])
102+
@test_throws MethodError mean(skipmissing([]))
103+
@test_throws ArgumentError mean((1 for i in 2:1))
102104

103105
# Check that small types are accumulated using wider type
104106
for T in (Int8, UInt8)
@@ -260,13 +262,15 @@ end
260262
end
261263

262264
@test isequal(var(Complex{Float64}[]), NaN)
263-
@test isequal(var(skipmissing(Complex{Float64}[])), NaN)
264265
@test var(Complex{Float64}[]) isa Float64
266+
@test isequal(var(skipmissing(Complex{Float64}[])), NaN)
265267
@test var(skipmissing(Complex{Float64}[])) isa Float64
266268
@test_throws MethodError var([])
267269
@test_throws MethodError var(skipmissing([]))
268-
@test_throws ArgumentError var((1 for i in 2:1))
270+
@test_throws MethodError var((1 for i in 2:1))
271+
@test isequal(var(Int[]), NaN)
269272
@test var(Int[]) isa Float64
273+
@test isequal(var(skipmissing(Int[])), NaN)
270274
@test var(skipmissing(Int[])) isa Float64
271275
end
272276

0 commit comments

Comments
 (0)