Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adapt alias macro docstring test to nightly changes #1807

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions test/AliasMacro-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 21 additions & 8 deletions test/Attributes-test.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using REPL # needed due to https://github.com/JuliaLang/julia/issues/53349

module Tmp
using AbstractAlgebra

Expand Down Expand Up @@ -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)
Expand Down
Loading