Skip to content

Commit b832bba

Browse files
committed
fix
1 parent cac6186 commit b832bba

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

src/persistence.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,20 @@ julia> using LightGraphs
3535
julia> test_graph = meta_graph(DiGraph(),
3636
AtVertex = Dict{Symbol, String},
3737
AtEdge = Dict{Symbol, String},
38-
graph_meta = (tagged = true,)
38+
graph_meta = (tag_1 = true, tag_2 = true)
3939
);
4040
41-
julia> a = push!(test_graph, Dict(:name => "a")); b = push!(test_graph, Dict(:name => "b"));
41+
julia> push!(test_graph, Dict(:name => "a")); push!(test_graph, Dict(:name => "b"));
4242
43-
julia> test_graph[Edge(a, b)] = Dict(:name => "ab");
43+
julia> test_graph[Edge(1, 2)] = Dict(:name => "ab");
4444
4545
julia> mktemp() do file, io
4646
savegraph(file, test_graph, DOTFormat())
4747
print(read(file, String))
4848
end
4949
digraph {
50-
tagged = true
50+
tag_1 = true
51+
tag_2 = true
5152
1 [name = "a"]
5253
2 [name = "b"]
5354
1 -> 2 [name = "ab"]

test/runtests.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,23 @@ graph_weights = weights(weighted_graph)
6969
@test graph_weights[rock, paper] == 1.0
7070
@test size(graph_weights) == (3, 3)
7171
end
72+
73+
undirected = meta_graph(Graph(),
74+
AtVertex = Nothing,
75+
AtEdge = Nothing
76+
)
77+
push!(undirected, nothing)
78+
push!(undirected, nothing)
79+
undirected[Edge(2, 1)] = nothing
80+
81+
@test !is_directed(undirected)
82+
@test mktemp() do file, io
83+
savegraph(file, undirected, DOTFormat())
84+
read(file, String)
85+
end == """
86+
graph {
87+
1
88+
2
89+
1 -- 2
90+
}
91+
"""

0 commit comments

Comments
 (0)