From 66279e2d6bf4edd2c7db678cd6aa55f7ab9d8396 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Thu, 19 Aug 2021 18:03:14 -0500 Subject: [PATCH] Generalize exception type In preparation for https://github.com/JuliaLang/julia/pull/41885 --- test/mapreduce.jl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/mapreduce.jl b/test/mapreduce.jl index 5c7c78ca..9589d351 100644 --- a/test/mapreduce.jl +++ b/test/mapreduce.jl @@ -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