Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for wantEdges (0.74 sec)

  1. src/internal/dag/parse_test.go

    	t.Helper()
    	g, err := Parse(dag)
    	if err != nil {
    		t.Fatal(err)
    	}
    	return g
    }
    
    func wantEdges(t *testing.T, g *Graph, edges string) {
    	t.Helper()
    
    	wantEdges := strings.Fields(edges)
    	wantEdgeMap := make(map[string]bool)
    	for _, e := range wantEdges {
    		wantEdgeMap[e] = true
    	}
    
    	for _, n1 := range g.Nodes {
    		for _, n2 := range g.Nodes {
    			got := g.HasEdge(n1, n2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 04 15:31:42 UTC 2022
    - 1.3K bytes
    - Viewed (0)
  2. src/internal/dag/alg_test.go

    	t.Run("diamond", func(t *testing.T) {
    		g := mustParse(t, diamond)
    		g.TransitiveReduction()
    		wantEdges(t, g, "b->a c->a d->b d->c")
    	})
    	t.Run("chain", func(t *testing.T) {
    		const chain = `NONE < a < b < c < d; a, d < e;`
    		g := mustParse(t, chain)
    		g.TransitiveReduction()
    		wantEdges(t, g, "e->d d->c c->b b->a")
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 04 15:31:44 UTC 2022
    - 1.1K bytes
    - Viewed (0)
Back to top