From 6d33c2266dc5a1a443e385f7088f2666e20a8707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Riedemann?= <38795484+longemen3000@users.noreply.github.com> Date: Sun, 1 Sep 2024 03:29:41 -0400 Subject: [PATCH] make Accessors.jl tests run --- test/test_core.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_core.jl b/test/test_core.jl index 3232bf68..85635eb2 100644 --- a/test/test_core.jl +++ b/test/test_core.jl @@ -603,9 +603,13 @@ end @accessor Base.Float64(s::MyStruct) = s.x[2] @accessor (t::MyStruct)(s::MyStruct) = s.x + t.x +#https://github.com/JuliaLang/julia/issues/54664: the return type of @doc f changes depending on REPL being loaded. +__string(s) = string(s) +__string(s::Base.Docs.DocStr) = join(collect(x.text),'\n') + @testset "@accessor" begin s = MyStruct((a=123,)) - @test strip(string(@doc(my_x))) == "Documentation for my_x" + @test strip(__string(@doc(my_x))) == "Documentation for my_x" @test (@set my_x(s) = 456) === MyStruct(456) @test (@set +s = 456) === MyStruct((a=5-456,)) test_getset_laws(my_x, s, 456, "1")