File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ An abstract type representing a simple graph structure.
50
50
"""
51
51
abstract type AbstractSimpleGraph{T<: Integer } <: AbstractGraph{T} end
52
52
53
- function show (io:: IO , g:: AbstractSimpleGraph{T} ) where T
53
+ function show (io:: IO , :: MIME"text/plain" , g:: AbstractSimpleGraph{T} ) where T
54
54
dir = is_directed (g) ? " directed" : " undirected"
55
55
print (io, " {$(nv (g)) , $(ne (g)) } $dir simple $T graph" )
56
56
end
Original file line number Diff line number Diff line change @@ -30,16 +30,18 @@ import Random
30
30
gx = SimpleGraph ()
31
31
for g in testgraphs (gx)
32
32
T = eltype (g)
33
- @test sprint (show , g) == " {0, 0} undirected simple $T graph"
33
+ @test repr ( " text/plain " , g) == " {0, 0} undirected simple $T graph"
34
34
@test @inferred (add_vertices! (g, 5 ) == 5 )
35
- @test sprint (show, g) == " {5, 0} undirected simple $T graph"
35
+ @test repr (" text/plain" , g) == " {5, 0} undirected simple $T graph"
36
+ @test eval (Meta. parse (repr (g))) == g
36
37
end
37
38
gx = SimpleDiGraph ()
38
39
for g in testdigraphs (gx)
39
40
T = eltype (g)
40
- @test sprint (show , g) == " {0, 0} directed simple $T graph"
41
+ @test repr ( " text/plain " , g) == " {0, 0} directed simple $T graph"
41
42
@test @inferred (add_vertices! (g, 5 ) == 5 )
42
- @test sprint (show, g) == " {5, 0} directed simple $T graph"
43
+ @test repr (" text/plain" , g) == " {5, 0} directed simple $T graph"
44
+ @test eval (Meta. parse (repr (g))) == g
43
45
end
44
46
45
47
gx = path_graph (4 )
You can’t perform that action at this time.
0 commit comments