Skip to content

Commit 30e9995

Browse files
committed
Add test for TYPEDSIGNATURENORETURN abbreviation
The abbreviation should behave in the same way as TYPEDSIGNATURE but omit the return type.
1 parent 93cd69a commit 30e9995

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/tests.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,26 @@ end
455455

456456
end
457457

458+
@testset "method signatures with types (no return type)" begin
459+
doc.data = Dict(
460+
:binding => Docs.Binding(M, :h_1),
461+
:typesig => Tuple{M.A},
462+
:module => M,
463+
)
464+
DSE.format(DSE.TYPEDSIGNATURESNORETURN, buf, doc)
465+
str = String(take!(buf))
466+
@test occursin("\n```julia\n", str)
467+
f = str -> replace(str, " " => "")
468+
str = f(str)
469+
if Sys.iswindows() && VERSION < v"1.8"
470+
@test occursin(f("h_1(x::Union{Array{T,4}, Array{T,3}} where T)"), str)
471+
else
472+
@test occursin(f("h_1(x::Union{Array{T,3}, Array{T,4}} where T)"), str)
473+
end
474+
@test !occursin("->", str)
475+
@test occursin("\n```\n", str)
476+
end
477+
458478
@testset "function names" begin
459479
doc.data = Dict(
460480
:binding => Docs.Binding(M, :f),

0 commit comments

Comments
 (0)