Skip to content

Commit

Permalink
Generalize exception type (#951)
Browse files Browse the repository at this point in the history
In preparation for JuliaLang/julia#41885
  • Loading branch information
timholy authored Aug 21, 2021
1 parent 4db80f1 commit f59bceb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,17 @@ using Statistics: mean

# When the mapping and/or reducing functions are unsupported,
# the error is thrown by `Base.mapreduce_empty`:
@test_throws(
ArgumentError("reducing over an empty collection is not allowed"),
mapreduce(nothing, nothing, SVector{0,Int}())
)
if Base.VERSION >= v"1.8.0-DEV.363"
@test_throws(
"reducing over an empty collection is not allowed",
mapreduce(nothing, nothing, SVector{0,Int}())
)
else
@test_throws(
ArgumentError("reducing over an empty collection is not allowed"),
mapreduce(nothing, nothing, SVector{0,Int}())
)
end
end

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

0 comments on commit f59bceb

Please sign in to comment.