(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestGraphColorUsingBFS(t *testing.T) { |
| 12 | for i, tt := range getTestGraphs() { |
| 13 | t.Run(strconv.Itoa(i), func(t *testing.T) { |
| 14 | colorsOfVertices, colors := tt.Graph.ColorUsingBFS() |
| 15 | if colors != tt.ColorsUsed { |
| 16 | t.Errorf("ColorUsingBFS() return more number of colors: %v, want %v colors", colors, tt.ColorsUsed) |
| 17 | } |
| 18 | // check colors |
| 19 | if err := tt.Graph.ValidateColorsOfVertex(colorsOfVertices); err != nil { |
| 20 | t.Errorf("ColorUsingBFS() assigned colors are wrong, error = %v", err) |
| 21 | } |
| 22 | }) |
| 23 | } |
| 24 | } |
nothing calls this directly
no test coverage detected