Skip to content

Commit

Permalink
Better coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Aug 1, 2021
1 parent d544d3a commit 3f09e06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/backedges.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A lightly-modified version of the same function in Base
# Highlights argument types with color specified by highlighter(typ)
function show_tuple_as_call(@nospecialize(highlighter), io::IO, name::Symbol, @nospecialize(sig::Type), demangle=false, kwargs=nothing)
function show_tuple_as_call(@nospecialize(highlighter), io::IO, name::Symbol, @nospecialize(sig::Type), demangle=false #=, kwargs=nothing =#)
if sig === Tuple
print(io, demangle ? Base.demangle_function_name(name) : name, "(...)")
return
Expand Down Expand Up @@ -34,16 +34,16 @@ function show_tuple_as_call(@nospecialize(highlighter), io::IO, name::Symbol, @n
first = false
printstyled(env_io, "::", sig[i], color=highlighter(sig[i]))
end
if kwargs !== nothing
print(io, "; ")
first = true
for (k, t) in kwargs
first || print(io, ", ")
first = false
print(io, k, "::")
show(io, t)
end
end
# if kwargs !== nothing
# print(io, "; ")
# first = true
# for (k, t) in kwargs
# first || print(io, ", ")
# first = false
# print(io, k, "::")
# show(io, t)
# end
# end
print(io, ")")
Base.show_method_params(io, tv)
nothing
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ fst5(x) = fst4(x)
mi = Cthulhu.get_specialization(Vector{Int}, Tuple{typeof(undef), Int})
io = IOBuffer()
@test Cthulhu.callstring(io, mi) == "Vector{$Int}(::UndefInitializer, ::$Int)"
mi = Cthulhu.get_specialization(similar, Tuple{Type{Vector{T}}, Dims{1}} where T)
@test occursin(r"31m::Type", Cthulhu.callstring(io, mi))

# treelist for stacktraces
tree = Cthulhu.treelist(fst5(1.0))
Expand Down

0 comments on commit 3f09e06

Please sign in to comment.