From 03d0c721bda8712dc872e86775a1d6a6c252ec40 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Thu, 12 Sep 2024 01:23:38 +0100 Subject: [PATCH] Only test error hint if it can be defined --- test/logdensityproblems.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/logdensityproblems.jl b/test/logdensityproblems.jl index 0b746d48..4a3a22d5 100644 --- a/test/logdensityproblems.jl +++ b/test/logdensityproblems.jl @@ -27,7 +27,9 @@ LogDensityProblems.logdensity(model, ones(10)) catch exc @test exc isa MethodError - @test occursin("is a wrapper", sprint(showerror, exc)) + if isdefined(Base.Experimental, :register_error_hint) + @test occursin("is a wrapper", sprint(showerror, exc)) + end end end