Skip to content

Commit 8cac180

Browse files
committed
Fix broken test
1 parent e79538b commit 8cac180

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

test/TestModule/M.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ i_4(x; y::T = zero(T), z::U = zero(U)) where {T, U} = x + y + z
2323
j_1(x, y) = x * y # two arguments, no keyword arguments
2424
j_1(x; y = x) = x * y # one argument, one keyword argument
2525

26+
k_0(x::T) where T = x
2627
k_1(x::String, y::T = 0, z::T = zero(T)) where T <: Number = x
2728
k_2(x::String, y::U, z::T) where T <: Number where U <: Complex = x
2829
k_3(x, y::T, z::U) where {T, U} = x + y + z
@@ -32,7 +33,6 @@ k_6(x::Vector{T}) where T <: Number = x
3233
k_7(x::Union{T,Nothing}, y::T = zero(T)) where {T <: Integer} = x
3334
k_8(x) = x
3435
k_9(x::T where T<:Any) = x
35-
k_10(x::T) where T = x
3636
k_11(x::Int, xs...) = x
3737
k_12(x::Int, xs::Real...) = x
3838

test/tests.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,17 @@ end
179179
end
180180

181181
@testset "method signatures with types" begin
182+
doc.data = Dict(
183+
:binding => Docs.Binding(M, :k_0),
184+
:typesig => Tuple{T} where T,
185+
:module => M,
186+
)
187+
DSE.format(DSE.TYPEDSIGNATURES, buf, doc)
188+
str = String(take!(buf))
189+
@test occursin("\n```julia\n", str)
190+
@test occursin("\nk_0(x) -> Any\n", str)
191+
@test occursin("\n```\n", str)
192+
182193
doc.data = Dict(
183194
:binding => Docs.Binding(M, :h_1),
184195
:typesig => Tuple{M.A},
@@ -285,7 +296,6 @@ end
285296
end
286297
@test occursin("\n```\n", str)
287298

288-
289299
doc.data = Dict(
290300
:binding => Docs.Binding(M, :k_5),
291301
:typesig => Union{Tuple{Type{T}, String}, Tuple{Type{T}, String, Union{Nothing, Function}}, Tuple{T}} where T <: Number,
@@ -387,16 +397,6 @@ end
387397

388398
end
389399

390-
doc.data = Dict(
391-
:binding => Docs.Binding(M, :k_10),
392-
:typesig => Tuple{T} where T,
393-
:module => M,
394-
)
395-
DSE.format(DSE.TYPEDSIGNATURES, buf, doc)
396-
str = String(take!(buf))
397-
@test_broken occursin("\n```julia\n", str)
398-
@test_broken occursin("\nk_10(x) -> Any\n", str)
399-
@test_broken occursin("\n```\n", str)
400400
end
401401

402402
@testset "function names" begin

0 commit comments

Comments
 (0)