@@ -9,12 +9,12 @@ using SimpleWeightedGraphs
9
9
@test @inferred (eltype (SimpleWeightedGraph (adjmx1))) == Int
10
10
@test_throws ErrorException SimpleWeightedGraph (adjmx2)
11
11
12
- @test @inferred (ne (SimpleWeightedGraph (PathDiGraph (5 )))) == 4
12
+ @test @inferred (ne (SimpleWeightedGraph (path_digraph (5 )))) == 4
13
13
@test @inferred (! is_directed (SimpleWeightedGraph))
14
14
15
15
@test @inferred (eltype (SimpleWeightedDiGraph ())) == Int
16
16
@test @inferred (eltype (SimpleWeightedDiGraph (adjmx2))) == Int
17
- @test @inferred (ne (SimpleWeightedDiGraph (PathGraph (5 )))) == 8
17
+ @test @inferred (ne (SimpleWeightedDiGraph (path_graph (5 )))) == 8
18
18
@test @inferred (is_directed (SimpleWeightedDiGraph))
19
19
20
20
@@ -23,7 +23,7 @@ using SimpleWeightedGraphs
23
23
@test @inferred (! add_vertices! (gbig, 10 ))
24
24
end
25
25
26
- gdx = SimpleWeightedDiGraph (PathDiGraph (4 ))
26
+ gdx = SimpleWeightedDiGraph (path_digraph (4 ))
27
27
gx = SimpleWeightedGraph ()
28
28
for g in testgraphs (gx)
29
29
T = eltype (g)
@@ -41,7 +41,7 @@ using SimpleWeightedGraphs
41
41
@test sprint (show, g) == " {5, 0} directed simple $T graph with $U weights"
42
42
end
43
43
44
- gx = SimpleWeightedGraph (PathGraph (4 ))
44
+ gx = SimpleWeightedGraph (path_graph (4 ))
45
45
46
46
gc = copy (gx)
47
47
@test_logs (:warn , " Note: adding edges with a zero weight to this graph type has no effect." ) add_edge! (gc, 4 , 1 , 0.0 )
@@ -56,13 +56,13 @@ using SimpleWeightedGraphs
56
56
@test @inferred (has_edge (g, 3 , 2 ))
57
57
58
58
gc = copy (g)
59
- @test @inferred (add_edge! (gc, 4 => 1 )) && gc == SimpleWeightedGraph (CycleGraph (4 ))
59
+ @test @inferred (add_edge! (gc, 4 => 1 )) && gc == SimpleWeightedGraph (cycle_graph (4 ))
60
60
@test @inferred (has_edge (gc, 4 => 1 )) && has_edge (gc, 0x04 => 0x01 )
61
61
gc = copy (g)
62
- @test @inferred (add_edge! (gc, (4 ,1 ))) && gc == SimpleWeightedGraph (CycleGraph (4 ))
62
+ @test @inferred (add_edge! (gc, (4 ,1 ))) && gc == SimpleWeightedGraph (cycle_graph (4 ))
63
63
@test @inferred (has_edge (gc, (4 ,1 ))) && has_edge (gc, (0x04 , 0x01 ))
64
64
gc = copy (g)
65
- @test add_edge! (gc, 4 , 1 ) && gc == SimpleWeightedGraph (CycleGraph (4 ))
65
+ @test add_edge! (gc, 4 , 1 ) && gc == SimpleWeightedGraph (cycle_graph (4 ))
66
66
67
67
@test @inferred (inneighbors (g, 2 )) == @inferred (outneighbors (g, 2 )) == @inferred (neighbors (g,2 )) == [1 ,3 ]
68
68
@test @inferred (add_vertex! (gc)) # out of order, but we want it for issubset
@@ -104,7 +104,7 @@ using SimpleWeightedGraphs
104
104
@test @inferred (has_edge (g, e))
105
105
end
106
106
107
- gdx = SimpleWeightedDiGraph (PathDiGraph (4 ))
107
+ gdx = SimpleWeightedDiGraph (path_digraph (4 ))
108
108
109
109
gc = copy (gdx)
110
110
@test_logs (:warn , " Note: adding edges with a zero weight to this graph type has no effect." ) add_edge! (gc, 4 , 1 , 0.0 )
@@ -122,13 +122,13 @@ using SimpleWeightedGraphs
122
122
@test @inferred (! has_edge (g, 3 , 2 ))
123
123
124
124
gc = copy (g)
125
- @test @inferred (add_edge! (gc, 4 => 1 )) && gc == SimpleWeightedDiGraph (CycleDiGraph (4 ))
125
+ @test @inferred (add_edge! (gc, 4 => 1 )) && gc == SimpleWeightedDiGraph (cycle_digraph (4 ))
126
126
@test @inferred (has_edge (gc, 4 => 1 )) && has_edge (gc, 0x04 => 0x01 )
127
127
gc = copy (g)
128
- @test @inferred (add_edge! (gc, (4 ,1 ))) && gc == SimpleWeightedDiGraph (CycleDiGraph (4 ))
128
+ @test @inferred (add_edge! (gc, (4 ,1 ))) && gc == SimpleWeightedDiGraph (cycle_digraph (4 ))
129
129
@test @inferred (has_edge (gc, (4 ,1 ))) && has_edge (gc, (0x04 , 0x01 ))
130
130
gc = @inferred (copy (g))
131
- @test @inferred (add_edge! (gc, 4 , 1 )) && gc == SimpleWeightedDiGraph (CycleDiGraph (4 ))
131
+ @test @inferred (add_edge! (gc, 4 , 1 )) && gc == SimpleWeightedDiGraph (cycle_digraph (4 ))
132
132
133
133
@test @inferred (inneighbors (g, 2 )) == [1 ]
134
134
@test @inferred (outneighbors (g, 2 )) == @inferred (neighbors (g,2 )) == [3 ]
@@ -172,7 +172,7 @@ using SimpleWeightedGraphs
172
172
@test @inferred (has_edge (g, e))
173
173
end
174
174
175
- gdx = SimpleWeightedDiGraph (CompleteDiGraph (4 ))
175
+ gdx = SimpleWeightedDiGraph (complete_digraph (4 ))
176
176
for g in testdigraphs (gdx)
177
177
@test rem_vertex! (g, 2 )
178
178
@test nv (g) == 3 && ne (g) == 6
@@ -181,7 +181,7 @@ using SimpleWeightedGraphs
181
181
@test sum (weights (g)) == 2 * ne (g) * 3
182
182
@test @inferred (get_weight (g, 1 , 2 )) == 3
183
183
184
- g = SimpleWeightedDiGraph (PathGraph (5 ), 4.0 )
184
+ g = SimpleWeightedDiGraph (path_graph (5 ), 4.0 )
185
185
@test sum (weights (g)) == ne (g) * 4.0
186
186
187
187
gx = Graph (4 ,3 )
@@ -194,11 +194,11 @@ using SimpleWeightedGraphs
194
194
@test eltype (SimpleWeightedGraph (g)) == eltype (g)
195
195
end
196
196
197
- s = SimpleWeightedGraph (PathGraph (5 ), 2 )
197
+ s = SimpleWeightedGraph (path_graph (5 ), 2 )
198
198
s2 = SimpleWeightedGraph ([1 ,2 ,3 ,4 ], [2 ,3 ,4 ,5 ], [2 ,2 ,2 ,2 ])
199
199
@test s == s2
200
200
201
- s = SimpleWeightedDiGraph (PathDiGraph (5 ), 2 )
201
+ s = SimpleWeightedDiGraph (path_digraph (5 ), 2 )
202
202
s2 = SimpleWeightedDiGraph ([1 ,2 ,3 ,4 ], [2 ,3 ,4 ,5 ], [2 ,2 ,2 ,2 ])
203
203
@test s == s2
204
204
0 commit comments