Skip to content

Commit b869a57

Browse files
authored
add tests
1 parent 2905da7 commit b869a57

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/runtests.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,21 @@ using Test
3030
include(joinpath("tutorial", "4_type_stability.jl"))
3131
end
3232
end
33+
34+
@testset verbose = true "Short-form add_vertex!/add_edge!" begin
35+
# short-form
36+
mg = MetaGraph(Graph(); Label=Symbol, VertexData=Nothing, EdgeData=Nothing)
37+
@test add_vertex!(mg, :A)
38+
@test add_vertex!(mg, :B)
39+
@test add_edge!(mg, :A, :B)
40+
41+
# long-form
42+
mg′ = MetaGraph(Graph(); Label=Symbol, VertexData=Nothing, EdgeData=Nothing)
43+
@test add_vertex!(mg′, :A, nothing)
44+
@test add_vertex!(mg′, :B, nothing)
45+
@test add_edge!(mg′, :A, :B, nothing)
46+
47+
# compare
48+
@test mg == mg′
49+
end
3350
end

0 commit comments

Comments
 (0)