diff --git a/src/graphs_api_extensions.jl b/src/graphs_api_extensions.jl index db2214f..14a0101 100644 --- a/src/graphs_api_extensions.jl +++ b/src/graphs_api_extensions.jl @@ -6,14 +6,17 @@ struct NautyAlg{S} NautyAlg(; sparse=false) = new{sparse}() end -"""Lists all functions for which an NautyAlg method is defined""" +"""Lists all functions for which a `NautyAlg` method is defined""" function nautyalg_methods() filter(names(@__MODULE__)) do s f = getproperty(@__MODULE__, s) f isa Function || return false any(methods(f)) do m - sig = m.sig isa UnionAll ? m.sig.body : m.sig - any(t -> t isa Type && t <: NautyAlg, sig.parameters) + sig = m.sig + while sig isa UnionAll; sig = sig.body; end + any(sig.parameters) do t + t isa Type && t <: NautyAlg + end end end end diff --git a/test/graphs_api_extensions.jl b/test/graphs_api_extensions.jl index 0354e52..22d9142 100644 --- a/test/graphs_api_extensions.jl +++ b/test/graphs_api_extensions.jl @@ -1,4 +1,6 @@ @testset "Graphs API extensions" begin + @test NautyGraphs.nautyalg_methods() isa Vector{Symbol} + g = path_graph(5) h = path_graph(5) k = star_graph(5)