From ec0a7ceecad3cc478c3d06ecf2def2921c323100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Besan=C3=A7on?= Date: Wed, 15 Jan 2020 10:23:27 +0100 Subject: [PATCH] new syntax for graph generators --- Project.toml | 4 ++-- test/runtests.jl | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Project.toml b/Project.toml index 7eb8370..e224355 100644 --- a/Project.toml +++ b/Project.toml @@ -7,12 +7,12 @@ version = "0.1.0" LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d" [compat] +LightGraphs = "1.3" julia = "1" -LightGraphs = "1" [extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Test", "Random"] diff --git a/test/runtests.jl b/test/runtests.jl index ca0ad89..830a232 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -18,7 +18,7 @@ const LG = LightGraphs @test LG.add_edge!(g1, 1, 3) @test LG.ne(g1) == 2 == LG.ne(g1_copy) + 1 - g2_inner = LG.CompleteGraph(nv) + g2_inner = LG.complete_graph(nv) g2 = VSafeGraph(g2_inner) @test LG.nv(g2) == LG.nv(g2_inner) @test LG.ne(g2) == LG.ne(g2_inner) @@ -29,7 +29,7 @@ const LG = LightGraphs @test LG.has_edge(g2, LG.SimpleEdge(1, 2)) @test LG.edgetype(g2) == LG.edgetype(g2_inner) - g3 = VSafeGraph(LG.CompleteDiGraph(30)) + g3 = VSafeGraph(LG.complete_digraph(30)) @test !LG.add_edge!(g3, 1, 2) # no possible addition on a complete graph @test !LG.add_edge!(g3, LG.SimpleEdge(1, 2)) @test LG.is_directed(g3) @@ -42,7 +42,7 @@ end @testset "Vertex deletion" begin Random.seed!(33) nv = 45 - inner = LG.CompleteGraph(nv) + inner = LG.complete_graph(nv) g = VSafeGraph(inner) @test LG.ne(inner) == LG.ne(g) @test LG.nv(inner) == LG.nv(g) @@ -68,7 +68,7 @@ end @testset "Edge addition" begin Random.seed!(45) nv = 10 - inner = LG.CompleteGraph(nv) + inner = LG.complete_graph(nv) g = VSafeGraph(inner) nea = 0 #number of edges added nrv = 0 #number of removed vertices @@ -100,7 +100,7 @@ end @testset "Neighbor sets" begin Random.seed!(99) nv = 10 - inner = LG.CompleteGraph(nv) + inner = LG.complete_graph(nv) g = VSafeGraph(inner) nrv = 0 for _ in 1:5 @@ -122,11 +122,9 @@ end end end - - @testset "Generic LG algorithms work" begin nv = 45 - inner = LG.CompleteGraph(nv) + inner = LG.complete_graph(nv) g = VSafeGraph(inner) removed_ok = LG.rem_vertex!(g, rand(1:nv)) @test removed_ok