|
87 | 87 | @test isequal(mean([missing 1.0; 2.0 3.0], dims=1), [missing 2.0]) |
88 | 88 | @test mean(skipmissing([1, missing, 2])) === 1.5 |
89 | 89 | @test isequal(mean(Complex{Float64}[]), NaN+NaN*im) |
90 | | - @test isequal(mean(skipmissing(Complex{Float64}[])), NaN+NaN*im) |
91 | 90 | @test mean(Complex{Float64}[]) isa Complex{Float64} |
| 91 | + @test isequal(mean(skipmissing(Complex{Float64}[])), NaN+NaN*im) |
92 | 92 | @test mean(skipmissing(Complex{Float64}[])) isa Complex{Float64} |
93 | 93 | @test isequal(mean(abs, Complex{Float64}[]), NaN) |
94 | | - @test isequal(mean(abs, skipmissing(Complex{Float64}[])), NaN) |
95 | 94 | @test mean(abs, Complex{Float64}[]) isa Float64 |
| 95 | + @test isequal(mean(abs, skipmissing(Complex{Float64}[])), NaN) |
96 | 96 | @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) |
100 | 98 | @test mean(Int[]) isa Float64 |
| 99 | + @test isequal(mean(skipmissing(Int[])), NaN) |
101 | 100 | @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)) |
102 | 104 |
|
103 | 105 | # Check that small types are accumulated using wider type |
104 | 106 | for T in (Int8, UInt8) |
@@ -260,13 +262,15 @@ end |
260 | 262 | end |
261 | 263 |
|
262 | 264 | @test isequal(var(Complex{Float64}[]), NaN) |
263 | | - @test isequal(var(skipmissing(Complex{Float64}[])), NaN) |
264 | 265 | @test var(Complex{Float64}[]) isa Float64 |
| 266 | + @test isequal(var(skipmissing(Complex{Float64}[])), NaN) |
265 | 267 | @test var(skipmissing(Complex{Float64}[])) isa Float64 |
266 | 268 | @test_throws MethodError var([]) |
267 | 269 | @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) |
269 | 272 | @test var(Int[]) isa Float64 |
| 273 | + @test isequal(var(skipmissing(Int[])), NaN) |
270 | 274 | @test var(skipmissing(Int[])) isa Float64 |
271 | 275 | end |
272 | 276 |
|
|
0 commit comments