(g *Graph, ops ...string)
| 24 | ) |
| 25 | |
| 26 | func hasOperations(g *Graph, ops ...string) error { |
| 27 | var missing []string |
| 28 | for _, op := range ops { |
| 29 | if g.Operation(op) == nil { |
| 30 | missing = append(missing, op) |
| 31 | } |
| 32 | } |
| 33 | if len(missing) != 0 { |
| 34 | return fmt.Errorf("Graph does not have the operations %v", missing) |
| 35 | } |
| 36 | |
| 37 | inList := map[string]bool{} |
| 38 | for _, op := range g.Operations() { |
| 39 | inList[op.Name()] = true |
| 40 | } |
| 41 | |
| 42 | for _, op := range ops { |
| 43 | if !inList[op] { |
| 44 | missing = append(missing, op) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | if len(missing) != 0 { |
| 49 | return fmt.Errorf("Operations %v are missing from graph.Operations()", missing) |
| 50 | } |
| 51 | |
| 52 | return nil |
| 53 | } |
| 54 | |
| 55 | func TestGraphWriteToAndImport(t *testing.T) { |
| 56 | // Construct a graph |
no test coverage detected