(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestArticulationPoints(t *testing.T) { |
| 9 | var testCases = []struct { |
| 10 | description string |
| 11 | graph Graph |
| 12 | expected []bool |
| 13 | }{ |
| 14 | { |
| 15 | "Linear tree structure", |
| 16 | Graph{ |
| 17 | vertices: 5, |
| 18 | edges: map[int]map[int]int{ |
| 19 | 0: { |
| 20 | 1: 0, |
| 21 | }, |
| 22 | |
| 23 | 1: { |
| 24 | 0: 0, |
| 25 | 2: 0, |
| 26 | }, |
| 27 | |
| 28 | 2: { |
| 29 | 1: 0, |
| 30 | 3: 0, |
| 31 | }, |
| 32 | |
| 33 | 3: { |
| 34 | 2: 0, |
| 35 | 4: 0, |
| 36 | }, |
| 37 | }, |
| 38 | }, |
| 39 | []bool{false, true, true, true, false}, |
| 40 | }, { |
| 41 | "A complete graph", |
| 42 | Graph{ |
| 43 | vertices: 4, |
| 44 | edges: map[int]map[int]int{ |
| 45 | 0: { |
| 46 | 1: 0, |
| 47 | 2: 0, |
| 48 | 3: 0, |
| 49 | }, |
| 50 | |
| 51 | 1: { |
| 52 | 0: 0, |
| 53 | 2: 0, |
| 54 | 3: 0, |
| 55 | }, |
| 56 | |
| 57 | 2: { |
| 58 | 0: 0, |
| 59 | 1: 0, |
| 60 | 3: 0, |
| 61 | }, |
| 62 | |
| 63 | 3: { |
| 64 | 0: 0, |
| 65 | 1: 0, |
nothing calls this directly
no test coverage detected