From 5cadd5f6c87a51f1199487c8b202e141dcba728c Mon Sep 17 00:00:00 2001 From: Yongan Lu Date: Tue, 18 Jun 2024 17:33:24 +0800 Subject: [PATCH] fix RaiseError test case workaround for serialize RaiseError will throws ArgumentError rather than MethodError after Julia 1.10 #25 --- test/runtests.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 6fddb6f..9bbef46 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -138,7 +138,11 @@ end @test_throws ValidationError deserialize(RaiseError(ValidationError("Invalid data.")), b"") @test_throws ErrorException serialize(RaiseError("Invalid data."), UndefProperty{Union{}}()) @test_throws ValidationError serialize(RaiseError(ValidationError("Invalid data.")), UndefProperty{Union{}}()) - @test_throws MethodError serialize(RaiseError("Invalid data."), nothing) + @static if Base.VERSION >= v"1.10-" + @test_throws ArgumentError serialize(RaiseError("Invalid data."), nothing) + else + @test_throws MethodError serialize(RaiseError("Invalid data."), nothing) + end end @testset "JuliaSerializer" begin @test estimatesize(JuliaSerializer()) == UnboundedSize(0)