Skip to content

Commit 0207655

Browse files
authored
Merge pull request JuliaAttic#230 from JuliaArchive/fixaddedgebounds-df
Fixaddedgebounds df
2 parents b56dbbe + 8b8548a commit 0207655

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

src/graph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ function add_edge!{V,E}(g::GenericGraph{V,E}, u::V, v::V, e::E)
104104
ui = vertex_index(u, g)::Int
105105
vi = vertex_index(v, g)::Int
106106

107-
push!(g.edges, e)
108107
push!(g.finclist[ui], e)
109108
push!(g.binclist[vi], e)
109+
push!(g.edges, e)
110110

111111
if !g.is_directed
112112
rev_e = revedge(e)

test/issue_related_tests.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# issue related tests
2+
3+
using Graphs
4+
using Base.Test
5+
6+
7+
8+
g = graph([1, 3], []) ## Create a graph with 2 vertices and no edges
9+
e = Edge(1, 4, 2)
10+
try
11+
add_edge!(g, 2, 4)
12+
catch
13+
end
14+
try
15+
add_edge!(g, e)
16+
catch
17+
end
18+
@test length(edges(g))==0

test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ tests = [
2020
"cliques",
2121
"random",
2222
"generators",
23-
"maximum_adjacency_visit" ]
23+
"maximum_adjacency_visit",
24+
"issue_related_tests" ]
2425

2526

2627
for t in tests

0 commit comments

Comments
 (0)