graph/encoding/dot: add tests for empty graphs

This commit is contained in:
Dan Kortschak
2021-03-20 07:58:39 +10:30
parent 163f1af942
commit c833bade6c

View File

@@ -424,6 +424,20 @@ var encodeTests = []struct {
want string
}{
// Empty graph.
{
name: "Empty Undirected",
g: simple.NewUndirectedGraph(),
want: `strict graph "Empty Undirected" {
}`,
},
{
name: "Empty Directed",
g: simple.NewDirectedGraph(),
want: `strict digraph "Empty Directed" {
}`,
},
// Basic graph.Graph handling.
{
name: "PageRank",