@@ -8,28 +8,24 @@ const testdir = dirname(@__FILE__)
8
8
9
9
@testset " StaticGraphs" begin
10
10
11
- h = loadgraph (joinpath (testdir, " testdata" , " house.jsg" ), SGFormat ())
12
- hu = loadgraph (joinpath (testdir, " testdata" , " house-uint8.jsg" ), SGFormat (UInt8))
13
- dh = loadgraph (joinpath (testdir, " testdata" , " pathdg.jsg" ), SDGFormat ())
14
- dhu = loadgraph (joinpath (testdir, " testdata" , " pathdg-uint8.jsg" ), SDGFormat (UInt8))
11
+ hu = loadgraph (joinpath (testdir, " testdata" , " house-uint8.jsg" ), SGFormat ())
12
+ dhu = loadgraph (joinpath (testdir, " testdata" , " pathdg-uint8.jsg" ), SDGFormat ())
15
13
16
14
@testset " staticgraph" begin
17
- @test sprint (show, StaticGraph (Graph ())) == " empty undirected simple static Int64 graph"
15
+ @test sprint (show, StaticGraph (Graph ())) == " empty undirected simple static {UInt8, UInt8} graph"
18
16
g = smallgraph (:house )
19
17
gu = squash (g)
20
18
sg = StaticGraph (g)
21
19
sgu = StaticGraph (gu)
22
- @test sprint (show, sg) == " {5, 6} undirected simple static Int64 graph"
23
- @test sprint (show, sgu) == " {5, 6} undirected simple static UInt8 graph"
20
+ @test sprint (show, sg) == " {5, 6} undirected simple static {UInt8, UInt8} graph"
21
+ @test sprint (show, sgu) == " {5, 6} undirected simple static { UInt8, UInt8} graph"
24
22
testfn (fn, args... ) =
25
- @inferred (fn (h, args... )) ==
26
23
@inferred (fn (hu, args... )) ==
27
24
@inferred (fn (sg, args... )) ==
28
25
@inferred (fn (sgu, args... )) ==
29
26
fn (g, args... )
30
27
31
- @test h == sg
32
- @test hu == sgu
28
+ @test hu == sg == sgu
33
29
@test @inferred eltype (hu) == UInt8
34
30
@test testfn (ne)
35
31
@test testfn (nv)
@@ -49,31 +45,27 @@ const testdir = dirname(@__FILE__)
49
45
@test @inferred has_vertex (hu, 1 )
50
46
@test @inferred ! has_vertex (hu, 10 )
51
47
@test @inferred ! is_directed (hu)
52
- @test @inferred ! is_directed (h)
53
48
@test @inferred ! is_directed (StaticGraph)
54
- @test @inferred collect (edges (h )) == collect (edges (sg))
49
+ @test @inferred collect (edges (hu )) == collect (edges (sg))
55
50
end # staticgraph
56
51
57
52
@testset " staticdigraph" begin
58
- @test sprint (show, StaticDiGraph (DiGraph ())) == " empty directed simple static Int64 graph"
53
+ @test sprint (show, StaticDiGraph (DiGraph ())) == " empty directed simple static {UInt8, UInt8} graph"
59
54
dg = PathDiGraph (5 )
60
55
dgu = squash (dg)
61
56
dsg = StaticDiGraph (dg)
62
57
dsgu = StaticDiGraph (dgu)
63
- @test sprint (show, dsg) == " {5, 4} directed simple static Int64 graph"
64
- @test sprint (show, dsgu) == " {5, 4} directed simple static UInt8 graph"
65
- dh = loadgraph (joinpath (testdir, " testdata" , " pathdg.jsg" ), SDGFormat ())
66
- dhu = loadgraph (joinpath (testdir, " testdata" , " pathdg-uint8.jsg" ), SDGFormat (UInt8))
58
+ @test sprint (show, dsg) == " {5, 4} directed simple static {UInt8, UInt8} graph"
59
+ @test sprint (show, dsgu) == " {5, 4} directed simple static {UInt8, UInt8} graph"
60
+ dhu = loadgraph (joinpath (testdir, " testdata" , " pathdg-uint8.jsg" ), SDGFormat ())
67
61
68
62
dtestfn (fn, args... ) =
69
- @inferred (fn (dh, args... )) ==
70
63
@inferred (fn (dhu, args... )) ==
71
64
@inferred (fn (dsg, args... )) ==
72
65
@inferred (fn (dsgu, args... )) ==
73
66
fn (dg, args... )
74
67
75
- @test dh == dsg
76
- @test dhu == dsgu
68
+ @test dhu == dsg == dsgu
77
69
@test @inferred eltype (dhu) == UInt8
78
70
@test dtestfn (ne)
79
71
@test dtestfn (nv)
@@ -93,9 +85,8 @@ const testdir = dirname(@__FILE__)
93
85
@test @inferred has_vertex (dhu, 1 )
94
86
@test @inferred ! has_vertex (dhu, 10 )
95
87
@test @inferred is_directed (dhu)
96
- @test @inferred is_directed (dh)
97
88
@test @inferred is_directed (StaticDiGraph)
98
- @test @inferred collect (edges (dh )) == collect (edges (dsg))
89
+ @test @inferred collect (edges (dhu )) == collect (edges (dsg))
99
90
end # staticdigraph
100
91
101
92
@testset " utils" begin
@@ -110,9 +101,7 @@ const testdir = dirname(@__FILE__)
110
101
111
102
@testset " persistence" begin
112
103
function writegraphs (f, fio)
113
- @test savegraph (f, h) == 1
114
104
@test savegraph (f, hu) == 1
115
- @test savegraph (f, dh) == 1
116
105
@test savegraph (f, dhu) == 1
117
106
end
118
107
mktemp (writegraphs)
0 commit comments