From a37673c5834451324450a15cff7dc72b154d09a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Fri, 20 Sep 2024 22:23:43 +0200 Subject: [PATCH] Adapt alias macro docstring test to nightly changes (#1807) --- test/AliasMacro-test.jl | 27 +++++++++++++++++++-------- test/Attributes-test.jl | 29 +++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/test/AliasMacro-test.jl b/test/AliasMacro-test.jl index af777859ca..a34a8dc2c3 100644 --- a/test/AliasMacro-test.jl +++ b/test/AliasMacro-test.jl @@ -30,12 +30,23 @@ end @test !(:isbar in names(Bla)) # verify docstring is correctly attached - @test string(@doc Bla.isfoo) == - """ - ``` - isfoo - ``` - - Alias for `is_foo`. - """ + if VERSION >= v"1.12.0-DEV.1223" + @test string(@doc Bla.isfoo) == + """ + ```julia + isfoo + ``` + + Alias for `is_foo`. + """ + else + @test string(@doc Bla.isfoo) == + """ + ``` + isfoo + ``` + + Alias for `is_foo`. + """ + end end diff --git a/test/Attributes-test.jl b/test/Attributes-test.jl index 2e0d09b777..e21e523039 100644 --- a/test/Attributes-test.jl +++ b/test/Attributes-test.jl @@ -1,3 +1,5 @@ +using REPL # needed due to https://github.com/JuliaLang/julia/issues/53349 + module Tmp using AbstractAlgebra @@ -210,14 +212,25 @@ my_derived_type(::Type{Tmp.Container{T}}) where T = T @test y === x # verify docstring is correctly attached - @test string(@doc cached_attr) == - """ - ``` - cached_attr(obj::T) where T - ``` - - A cached attribute. - """ + if VERSION >= v"1.12.0-DEV.1223" + @test string(@doc cached_attr) == + """ + ```julia + cached_attr(obj::T) where T + ``` + + A cached attribute. + """ + else + @test string(@doc cached_attr) == + """ + ``` + cached_attr(obj::T) where T + ``` + + A cached attribute. + """ + end # test function location is tracked accurately (this requires that the # definition of uncached_attr is before that of cached_attr)