You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pgraph_test.go
    path of file: ./repos/mgmt/pgraph
    
    the code of the file until where you have to start completion: // Mgmt
// Copyright (C) 2013-2024+ James Shubin and the project contributors
// Written by
    
func TestTopoSort1(t *testing.T) {
	G, _ := NewGraph("g9")
	v1 := NV("v1")
	v2 := NV("v2")
	v3 := NV("v3")
	v4 := NV("v4")
	v5 := NV("v5")
	v6 := NV("v6")
	e1 := NE("e1")
	e2 := NE("e2")
	e3 := NE("e3")
	e4 := NE("e4")
	e5 := NE("e5")
	e6 := NE("e6")
	G.AddEdge(v1, v2, e1)
	G.AddEdge(v1, v3, e2)
	G.AddEdge(v2, v4, e3)
	G.AddEdge(v3, v4, e4)

	G.AddEdge(v4, v5, e5)
	G.AddEdge(v5, v6, e6)

	indegree := G.InDegree() // map[Vertex]int
	if i := indegree[v1]; i != 0 {
		t.Errorf("indegree of v1 should be 0 instead of: %d", i)
	}
	if i := indegree[v2]; i != 1 {
		t.Errorf("indegree of v2 should be 1 instead of: %d", i)
	}
	if i := indegree[v3]; i != 1 {
		t.Errorf("indegree of v3 should be 1 instead of: %d", i)
	}
	if i := indegree[v4]; i != 2 {
		t.Errorf("indegree of v4 should be 2 instead of: %d", i)
	}
	if i := indegree[v5]; i != 1 {
		t.Errorf("indegree of v5 should be 1 instead of: %d", i)
	}
	if i := indegree[v6]; i != 1 {
		t.Errorf("indegree of v6 should be 1 instead of: %d", i)
	}

	outdegree := G.OutDegree() // map[Vertex]int
	if i := outdegree[v1]; i != 2 {
		t.Errorf("outdegree of v1 should be 2 instead of: %d", i)
	}
	if i := outdegree[v2]; i != 1 {
		t.Errorf("outdegree of v2 should be 1 instead of: %d", i)
	}
	if i := outdegree[v3]; i != 1 {
		t.Errorf("outdegree of v3 should be 1 instead of: %d", i)
	}
	if i := outdegree[v4]; i != 1 {
		t.Errorf("outdegree of v4 should be 1 instead of: %d", i)
	}
	if i := outdegree[v5]; i != 1 {
		t.Errorf("outdegree of v5 should be 1 instead of: %d", i)
	}
	if i := outdegree[v6]; i != 0 {
		t.Errorf("outdegree of v6 should be 0 instead of: %d", i)
	}

	s, err := G.TopologicalSort()
	// either possibility is a valid toposort
	match := reflect.DeepEqual(s, []Vertex{v1, v2, v3, v4, v5, v6}) || reflect.DeepEqual(s, []Vertex{v1, v3, v2, v4, v5, v6})
	if err != nil || !match {
		t.Errorf("topological sort failed, error: %v", err)
		str := "Found:"
		for _, v := range s {
			str += " " + v.String()
		}
		t.Errorf(str)
	}
}