graph/encoding/dot: add tests for empty graphs
MODIFY
graph/encoding/dot/encode_test.go
graph/encoding/dot/encode_test.go
@@ -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",

graph/encoding/dot: add tests for empty graphs