Skip to content

Commit e24d250

Browse files
Add random graphs to interface check
1 parent 2b863ea commit e24d250

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/VNGraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ end
138138
Base.eltype(::VNGraph) = Cuint
139139
Base.zero(::Type{VNGraph}) = VNGraph(0)
140140
Graphs.edgetype(g::VNGraph) = Graphs.SimpleGraphs.SimpleEdge{eltype(g)}
141-
Graphs.has_edge(g::VNGraph,s,d) = graph_has_edge(g,s,d)
141+
Graphs.has_edge(g::VNGraph,s,d)::Bool = graph_has_edge(g,s-1,d-1)
142142
Graphs.has_vertex(g::VNGraph,n::Integer) = 1nnnodes(g)
143143
Graphs.inneighbors(g::VNGraph, v::Integer) = Graphs.outneighbors(g, v)
144144
Graphs.is_directed(::Type{VNGraph}) = false

test/test_consistency.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ g = VNGraph(5); for i in 2:5 Graphs.add_edge!(g,1,i) end; Graphs.add_edge!(g,2,5
1616
@test VNGraphs.graph_chromatic_number(g,0)==3
1717

1818
@testset "Graphs.jl Interface Check for VNGraph" begin
19-
vngs = [VNGraph(12), VNGraph(20), VNGraph(5)]
19+
vngs = [
20+
VNGraph(12),
21+
VNGraph(20),
22+
VNGraph(5),
23+
VNGraph(Graphs.random_regular_graph(5, 4)),
24+
VNGraph(Graphs.random_regular_graph(10, 3)),
25+
VNGraph(Graphs.random_regular_graph(12, 5)),
26+
]
2027
Interfaces.@implements GraphsInterfaceChecker.AbstractGraphInterface VNGraph vngs
2128
@test Interfaces.test(GraphsInterfaceChecker.AbstractGraphInterface, VNGraph)
2229
end

0 commit comments

Comments
 (0)