Skip to content

Commit d9f049e

Browse files
committed
Add test for deprecated squash(::AbstractGraph)
1 parent 333fdef commit d9f049e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/core.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,21 @@
9696
@test @inferred(density(g)) == 0.4
9797
end
9898
end
99+
100+
@testset "squash" for (g_in, g_expected) in [
101+
(SimpleGraph{Int64}(), SimpleGraph{UInt8}()),
102+
(SimpleDiGraph{UInt8}(), SimpleDiGraph{UInt8}()),
103+
(path_graph(Int16(126)), path_graph(UInt8(126))),
104+
(path_digraph(Int16(127)), path_digraph(UInt8(127))),
105+
(path_graph(Int16(254)), path_graph(UInt8(254))),
106+
(path_digraph(Int16(255)), path_digraph(UInt16(255))),
107+
(path_graph(UInt16(255)), path_graph(UInt16(255))),
108+
(star_graph(Int16(32766)), star_graph(UInt16(32766))),
109+
(star_digraph(Int32(32767)), star_digraph(UInt16(32767))),
110+
(cycle_graph(Int128(123)), cycle_graph(UInt8(123))),
111+
]
112+
g_actual = squash(generic_graph(g_in))
113+
@test typeof(g_actual) === typeof(g_expected)
114+
@test g_actual == g_expected
115+
end
99116
end

0 commit comments

Comments
 (0)