Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}())
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For anyone (like myself) thinking this use of @test_throws looks confusing... see JuliaLang/julia#41888

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