Skip to content

Commit f59bceb

Browse files
authored
Generalize exception type (#951)
In preparation for JuliaLang/julia#41885
1 parent 4db80f1 commit f59bceb

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

test/mapreduce.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,17 @@ using Statistics: mean
9090

9191
# When the mapping and/or reducing functions are unsupported,
9292
# the error is thrown by `Base.mapreduce_empty`:
93-
@test_throws(
94-
ArgumentError("reducing over an empty collection is not allowed"),
95-
mapreduce(nothing, nothing, SVector{0,Int}())
96-
)
93+
if Base.VERSION >= v"1.8.0-DEV.363"
94+
@test_throws(
95+
"reducing over an empty collection is not allowed",
96+
mapreduce(nothing, nothing, SVector{0,Int}())
97+
)
98+
else
99+
@test_throws(
100+
ArgumentError("reducing over an empty collection is not allowed"),
101+
mapreduce(nothing, nothing, SVector{0,Int}())
102+
)
103+
end
97104
end
98105

99106
@testset "implemented by [map]reduce and [map]reducedim" begin

0 commit comments

Comments
 (0)