Skip to content

Commit 47e435e

Browse files
committed
tests
1 parent 022badf commit 47e435e

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/MetaGraphs.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ show(io::IO, ::MIME"text/plain", weights::MetaWeights) = show(io, weights)
142142

143143
MetaWeights(meta::AbstractMetaGraph) = MetaWeights{weight_type(meta), typeof(meta)}(meta)
144144

145-
is_directed(::Type{<: MetaWeights{<: Any, InnerMetaGraph}}) where {InnerMetaGraph} =
146-
is_directed(InnerMetaGraph)
147-
148145
function getindex(weights::MetaWeights{Weight}, in_vertex::Integer, out_vertex::Integer)::Weight where {Weight}
149146
edge = Edge(in_vertex, out_vertex)
150147
inner_meta_graph = weights.inner_meta_graph

src/metadigraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function meta_graph(inner_graph::DiGraph{Vertex};
2424
)
2525
end
2626

27-
SimpleDiGraph(g::MetaDiGraph) = g.graph
27+
SimpleDiGraph(g::MetaDiGraph) = g.inner_graph
2828

2929
is_directed(::Type{<: MetaDiGraph}) = true
3030

src/metagraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function meta_graph(inner_graph::AbstractGraph{Vertex};
118118
)
119119
end
120120

121-
SimpleGraph(g::MetaGraph) = g.graph
121+
SimpleGraph(g::MetaGraph) = g.inner_graph
122122

123123
is_directed(::Type{<: MetaGraph}) = false
124124

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ end
3737
@test has_edge(test, Edge(rock, scissors))
3838
@test has_vertex(test, rock)
3939
@test issubset(test2, test)
40+
@test SimpleDiGraph(test) isa SimpleDiGraph
4041
end
4142

4243
test2 = copy(test)
@@ -68,3 +69,6 @@ w = weights(test)
6869
@test w[rock, paper] == 1.0
6970
@test size(w) == (3, 3)
7071
end
72+
73+
test = meta_graph(Graph())
74+
@test SimpleGraph(test) isa SimpleGraph

0 commit comments

Comments
 (0)